The is_array will still give a warning is the variable array does not exist.
Use isset()
----- Original Message ----- 
From: "craig" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 06, 2004 5:35 PM
Subject: RE: [PHP] Surpressing a 'foreach' Error Message


> > craig <mailto:[EMAIL PROTECTED]>
> >     on Friday, February 06, 2004 2:24 PM said:
> >
> > > if (is_array($project))
> > >   foreach ($project as $project_id => $value) {
> > >     $fields[] = $project_id;
> > >     $values[] = $value;
> > >   }
> > > }
> >
> > you're missing a curly brace after the if ().
> >
>
> my bad, that's what you get when you don't actually
> run the code. Thank god for compilers ;)
>
> -Craig
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to