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



In article <4818D862.4010404@xxxxxxxx>, afan pasalic wrote:
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).

Looking at the manual page I think they will use an integer to calculate
the sum (when using a non assoc array).

.....

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

The best way to handle this would be to make sure null values will not get
into the array. A second choice might be using the mktime().

php.net/mktime

Hans

--
IM: hans.wolters@xxxxxxxxx
http://lonki.xs4all.nl

.



Relevant Pages

  • Re: Coverage Calculation Speed in VBA, VB, C# and C++
    ... know better is to declare an array that has say, 13,983,616 elements ... predict that the crown for King of Coverage Speed Calculation will ... themself, like myself, we have Michael Harrington to thank for much ... My slow desktop computer is 2.4 Ghz and 480 MB of RAM. ...
    (rec.gambling.lottery)
  • Re: Sumproduct with Autofilter
    ... Well let's start by stating that an array formula, ... of the Offset function to achieve the result. ... result by the total unit volume to achieve a weighted average "rate". ... calculation at the top, but this would require me to insert 64 calculated ...
    (microsoft.public.excel.programming)
  • Re: Function/Procedure dependence & order of execution
    ... every function1 dependent on something1 and every function2 dependent on ... > My spreadsheet has a Procedure that creates an array of data locations. ... > worksheet Function1 uses this array to perform it's calculation. ... > Function2 are used in many different cells. ...
    (microsoft.public.excel.programming)
  • Re: Advanced data structures
    ... How are you going to calculate the address without extra runtime cost? ... If the array is not a static array then you can't use the fixed offset trick without doing extra arithmetic at run time. ... If you build your software for 0 based arrays you build it in to the calculation, if it is 1 based you can't do that and if it is a function doing the calculation it might not be possible for the compiler to optimise away. ...
    (comp.lang.c)
  • I believe Ive found an Access bug...can anyone confirm?
    ... Access calculation is at the top and the near duplicate Excel code with late ... Dim IngSizeA As Long ... Dim IRRValuesAAs Double ' Set up array ... 'IRRCashFlowA are all of the cashflows from 1 to one minus the term ...
    (microsoft.public.access.modulesdaovba)