Re: url variable defined?

From: Date: Tue, 08 Aug 2000 14:32:39 +0000
Subject: Re: url variable defined?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-10669@lists.php.net to get a copy of this message
The function you are looking for is called isset: <?php if (!isset($var)) $var = 1; ?> See http://www.php.net/manual/function.isset.php --Matt ---------------------------------------------------------------- Matthew Leingang 617/495-2171 Harvard University leingang@math.harvard.edu Department of Mathematics "This signature needs no quote." On Tue, 8 Aug 2000 venome@gmx.net wrote: > how can i tell if a variable was defined in the url, like this: > > http://blah.com?var=value > > or not? if not, i want it to have a default value, like this > > <? if ($var not defined) { > $var = 1 > } ?> > > -- > Sent through GMX FreeMail - http://www.gmx.net > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#10669) next »