At 3:36 PM -0500 4/30/08, afan pasalic wrote:
hi,
as a result of one calculation I'm receiving an array where elements
could be 0 or date (as string -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
i dont really see how that gets him the answer without at least checking the
number of elements in the array after filtering it w/ array_filter; which if
he wanted to reuse in several places would make sense to write a simple
function for anyway..
Yes, on both counts.
--
Richard Heyes
+---
2008/4/30 Nathan Nobbe <[EMAIL PROTECTED]>:
> On Wed, Apr 30, 2008 at 2:58 PM, Richard Heyes <[EMAIL PROTECTED]> wrote:
>
> > but I was thinking if there is the function does that.
> >>
> >
> > array_filter(). Note this:
> >
> > "If no callback is supplied, all entries of input equal to FALSE
On Wed, Apr 30, 2008 at 2:58 PM, Richard Heyes <[EMAIL PROTECTED]> wrote:
> but I was thinking if there is the function does that.
>>
>
> array_filter(). Note this:
>
> "If no callback is supplied, all entries of input equal to FALSE (see
> converting to boolean) will be removed."
>
> http://uk3.p
yup! that's the one
:D
thanks richard
Richard Heyes wrote:
>> but I was thinking if there is the function does that.
>
> array_filter(). Note this:
>
> "If no callback is supplied, all entries of input equal to FALSE (see
> converting to boolean) will be removed."
>
> http://uk3.php.net/manual/
but I was thinking if there is the function does that.
array_filter(). Note this:
"If no callback is supplied, all entries of input equal to FALSE (see
converting to boolean) will be removed."
http://uk3.php.net/manual/en/function.array-filter.php
--
Richard Heyes
+
On Wed, Apr 30, 2008 at 2:36 PM, afan pasalic <[EMAIL PROTECTED]> wrote:
> hi,
> as a result of one calculation I'm receiving an array where elements
> could be 0 or date (as string -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
hi,
as a result of one calculation I'm receiving an array where elements
could be 0 or date (as string -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 k
8 matches
Mail list logo