Re: foreachif suggestion
- From: Captain Paralytic <paul_lautman@xxxxxxxxx>
- Date: Mon, 30 Jun 2008 07:27:47 -0700 (PDT)
On 28 Jun, 12:40, Hugh Oxford <ares...@xxxxxxx> wrote:
Can I suggest a new PHP native function, "foreachif".
At the moment I am trying to make my code run cleanly even if warnings
are switched on. If I do a foreach on a non-existent array, I get a warning.
So I have to do
if($array) foreach($array as $foo){};
foreachif would only run if the array was not empty.
If the array is in fact non-existent, then if($array) will fail unless
$array is an initialised variable of a different type.
.
- References:
- foreachif suggestion
- From: Hugh Oxford
- foreachif suggestion
- Prev by Date: Re: how to store the path of uploading file....
- Next by Date: Re: what does two semicolns ';;' do
- Previous by thread: Re: foreachif suggestion
- Next by thread: php4 attempting to find php5ts.dll
- Index(es):
Relevant Pages
|