Array Search

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear List -

Here is a code snippet:

    $bla = array("g1" => $results[7][6],
               "h1"  => $results[7][7]);
    print_r($bla);
    $value = "h1";
       $locate1 = array_search($value, $bla);
       echo "This is locate" ; print_r($locate1);
       if(in_array($value, $bla)) print_r($bla);

Neither the array_search or the in_array functions give any results. I have tried it with both h1 and "h1";

$results[7][6]  = Wn;
$results[7][7]  =  Wr;

This is a chess board where g1 and h1 are the coordinates and the results array contains the pieces at that coordinate.

What am I doing wrong?

Advice and comments please.

Thanks.

Ethan Rosenberg


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux