There's also possible to do a simple "try"

if($variable)
        echo 'It contains something';
else
        echo 'Has nothing inside, unless it's a 0';


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-----Original Message-----
From: Ankur Verma [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 3:29 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] How to check if vaiable is defined or not?


try using

isset() or empty()

see the php manual for more details

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India

----- Original Message -----
From: "SED" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 13, 2001 4:51 AM
Subject: [PHP] How to check if vaiable is defined or not?


> Hi,
>
> I'm sending a form, with check-boxes, via post to PHP-script and if the
> boxes are not checked they don't post value for its variable - Can I check
> with a function if the variable is defined? (or should I focus on another
> solution?)
>
> Regards,
> Sumarlidi Einar Dadason
>
> SED - Graphic Design
>
> ------------------------------------------
> Phone:       (+354) 4615501
> Mobile:      (+354) 8960376
> Fax:         (+354) 4615503
> E-mail:      [EMAIL PROTECTED]
> Homepage:    www.sed.is <- New Homepage!
> ------------------------------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to