Re: How do I convert from perl to php?
| From: | Robin Chen | Date: | Wed, 21 Nov 2001 05:23:57 +0000 |
| Subject: | Re: How do I convert from perl to php? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-75355@lists.php.net to get a copy of this message | ||
Oops, I didn't mean to post the same code that's been posted. The
subject sorter doesn't work correctly on Netscape Messenger. I thought
I had finished reading the thread.
My apologies,
Robin
Robin Chen wrote:
>
> <?
>
> $required = array('name','address','phone');
> $has_empty = 0;
>
> foreach ($required as $var) {
> if (!is_set($$var)) $has_empty = 1;
> }
>
> if ($has_empty) print 'You left one empty.';
>
> ?>
>
> You don't need to use the $has_empty variable, but I thought it would be
> better to just display the message once.
>
> Robin
>