check if any element of an array is not "empty"



hi,
as a result of one calculation I'm receiving an array where elements
could be 0 or date (as string yyyy-mm-dd hh:ii:ss).
I have to check if any of elements of the array is "date" or if all
elements of the array is 0?

If I try array_sum($result) I'll get 0 no matter what (0 + $string = 0).

I know I can do something like:
foreach($result as $value)
{
if ($value !=0)
{
$alert = true;
}
}

or

if (in_array($result, '-'))
{
$alert = true;
}


but I was thinking if there is the function does that.

thanks for any help.

-afan
.



Relevant Pages

  • Which comparator to override
    ... I have a map of objects in my code. ... and basically the root alert object is the key to an array of duplicate ... So basically the map contains keys of Alert objects and they map to ...
    (comp.lang.ruby)
  • Ruby Array -> String Conversion Issue
    ... (Newbie Alert!) ... I have a CGI script that takes an address and tries to put it as hidden ... form data on a new page. ... This code generates the complaint that "part" is an array, ...
    (comp.lang.ruby)
  • Re: Which comparator to override
    ... specifying that the id of the alert was to be the key as opposed to the ... I have a map of objects in my code. ... and basically the root alert object is the key to an array of duplicate ...
    (comp.lang.ruby)
  • Re: [PHP] check if any element of an array is not "empty"
    ... as a result of one calculation I'm receiving an array where elements ... I have to check if any of elements of the array is "date" or if all ... $alert = true; ...
    (php.general)
  • Re: [PHP] check if any element of an array is not "empty"
    ... as a result of one calculation I'm receiving an array where elements ... I have to check if any of elements of the array is "date" or if all ... $alert = true; ...
    (php.general)