Philipp Schwarz wrote:
> Try this:
>
> if (is_array($array) && count($array)) {
given that your not interested in the actual count of the array,
only that is is not empty, save yourself a couple of CPU cycles
and use empty() instead ...
if (is_array($array) && !empty($array)) {
foreach ($array as $k => $v) echo htmlentities("$v = $k<br />");
}
> ...
> }
>
> John Taylor-Johnston schrieb:
>> How can I use "if" to see an array contains something?
>>
>> if ($array()) does not work, of course.
>>
>> John
>>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php