Re: in_array w/statement

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

 



> reason it seems to always be true, ... something i'm doing wrong? btw, i
> cannot add the in_array to the statement because if the $buddylist is empty
> it will generate errors because of the empty implode.

you could add the is_array() check.

> $buddylist = preg_split('/( )+/', trim($userinfo['buddylist']), -1,
> PREG_SPLIT_NO_EMPTY);
> 
> if($buddylist)
> {
>  $buddy = in_array($uname['uid'], array(implode(',', $buddylist)));
> }

not sure I understand this, implode returns a string, then you are
putting that string into the array() function.  I dont know what kind
of data you would get back from that.  $buddylist should already be an
array.

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