Undefined offset: 0 when looping through array in PHP -


i looping through array (in php) , depending on string values push data other arrays. code:

for ($x = 0; $x <= sizeof($matchesadressrightvalues); $x++) {     $searchsucces = 'geocoding parameters';    $searchunsucces = 'unsuccessful';     //echo(strpos($matchessuccessrightvalues[$x][0], $searchsucces));     if(strpos($matchessuccessrightvalues[$x][0], $searchsucces) !== false)  {       array_push($arraysucunsuc,'success');       array_push($arrayaddress,$matchesadressrightvalues[$x][0]);    }     else if (strpos($matchessuccessrightvalues[$x][0], $searchunsucces) !== false){       array_push($arraysucunsuc,'not_success');       array_push($arrayaddress,$matchesadressrightvalues[$x][0]);     }     }  // end 

when execute warning message:

notice: undefined offset: 0 in /home/enomix/www/wind/geocoding/mywebcrawler.php on line 81

line 81 is:

if(strpos($matchessuccessrightvalues[$x][0], $searchsucces) !== false)   

if try echo array $matchessuccessrightvalues[$x][0] putting random values in $x results correctly. know not out of index.

my array looks this:

array  (    [0] => array       (         [0] => 28 ΟΚΤΩΒΡΙΟΥ 11,27100,ΗΛΕΙΑ,ΠΥΡΓΟΣ 

[2015/06/21 03:10:51] geocoding parameters: city )

   [1] => array     (         [0] => ΜΑΝΩΛΟΠΟΥΛΟΥ 11,27100,ΗΛΕΙΑ,ΠΥΡΓΟΣ 

[2015/06/21 03:42:54] geocoding parameters: city )

    [2] => array.......... 

what strange size of newly generated array: $arrayaddress (because although warning generated!) smaller size of initial array $matchesadressrightvalues.

any idea missing here?


Comments