Re: in_array - what the...

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

 



On 25 June 2010 19:58, Bob McConnell <rvm@xxxxxxxxx> wrote:
> From: Daevid Vincent
>
>> Why do this "in_array()" business??
>>
>> Just do this...
>>
>> if (self::$aboveArray[$name])
>> {
>>    //something interesting here
>> }
>
> Does that gibberish actually do something? It doesn't make any sense to
> me, while in_array() actually looks like what it does.
>

Gibberish?? Probably a good time to go look up some php tutorials.
Apart from that, it's rather bad form as a missing index will create a
notice at the least. The isset snippet is better, though if you care
about finding null values you need to go the route of array_keys().

Regards
Peter

-- 
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15
</hype>

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