Re: Re: Array Search - Solved

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

 



At 01:31 PM 3/25/2011, João Cândido de Souza Neto wrote:
It´s a job to array_key_exists  function.

--
João Cândido de Souza Neto

"Ethan Rosenberg" <ethros@xxxxxxxxxxxxx> escreveu na mensagem
news:0LIM00HI3IHNYX10@xxxxxxxxxxxxxxxxxxxxxxxxx
> 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
>

++++++++++++
Thank you.  It works!!

Ethan

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



--
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