ternary operator ... if/else shorthand; here's the long way to to do it: if(isset($string2)) { $string1 = $HTTP_GET_VARS['pid']; } else { $string1 = ""; }
-or- $string1 = ""; if(isset($string2)) { $string1 = $HTTP_GET_VARS['pid']; } Hank On Wed, Nov 28, 2001 at 08:28:12PM -0500, Gerard Samuel wrote: > Hi. Im looking over someone else's code and I come across something I > dont understand and dont know where in the manual to look for it. > Here is an example ==> > > $string1 = (isset($string2)) ? $HTTP_GET_VARS['pid'] : ""; > > I have no idea what the '?' in the line and the ':' at the end, so I > have no way of interpreting what $string1 could be. > If you could point me to the page in the manual that would be great. > > Thanks... > > > -- > 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] > -- Hank Marquardt <[EMAIL PROTECTED]> http://web.yerpso.net GPG Id: 2BB5E60C Fingerprint: D807 61BC FD18 370A AC1D 3EDF 2BF9 8A2D 2BB5 E60C *** Web Development: PHP, MySQL/PgSQL - Network Admin: Debian/FreeBSD *** PHP Instructor - Intnl. Webmasters Assn./HTML Writers Guild *** Beginning PHP -- Starts January 7, 2002 *** See http://www.hwg.org/services/classes -- 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]