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
On Mon, Feb 12, 2001 at 11:21:45PM -, SED wrote:
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?)
try:
isset($var);
return true is variable is set, false otherwise. Check www.php.net for more
info.
Reuben D. B
At 11:21 PM 2/12/01 +, SED wrote:
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
if (isset($var))
-Original Message-
From: SED [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 12, 2001 6:22 PM
To: [EMAIL PROTECTED]
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
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
5 matches
Mail list logo