|
Posted by Rik on 08/13/07 20:34
On Mon, 13 Aug 2007 22:33:27 +0200, zzapper <zzapper@gmail.com> wrote:
> On Aug 13, 5:39 pm, Rik <luiheidsgoe...@hotmail.com> wrote:
>> On Mon, 13 Aug 2007 18:36:20 +0200, gosha bine <stereof...@gmail.com>
>> wrote:
>>
>> > On 13.08.2007 17:32zzapperwrote:
>> >> Hi,
>> >> Have tried to google this without 100% satisfaction.
>> >> A function reads a mysql record into an array and returns it, if it
>> >> doesnt exist it returns '' or FALSE.
>> >> What ways do I have to test that my returned array is not empty
>>
>> > if(array_filter($ary))
>> > $ary contains at least one non-empty element
>> > else
>> > $ary contains 0 elements or all elements are empty
>>
> Like it
>
> Are we going to vote this best solution?
>
Except it might be better for the function to return false instead of an
empty array, yes indeed, I'd say so :)
--
Rik Wasmus
Navigation:
[Reply to this message]
|