accessing CONSTANTS

From: Date: Sun, 01 Oct 2000 00:51:25 +0000
Subject: accessing CONSTANTS
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-18180@lists.php.net to get a copy of this message
thanx to those who helped me with the question on < and > characters! :) another question i have is regarding accessing constants. eg, define ("ADMIN", "admin@xyz.com"); echo "send mail to <a href=\"mailto: ADMIN\">admin</a>" PHP interperts ADMIN as a string... is there anyway to access the value of a constant? $ad = ADMIN doesn't do the trick either... it again evaluates ADMIN to be the string "ADMIN"... thanx in advance! ---------------- remco chang bountyquest.com On Sat, 30 Sep 2000, Matt McClanahan wrote: > On Sat, 30 Sep 2000, Remco Chang wrote: > > > i'm having trouble concatenating strings with the characters '<' and > > '>'. > > > > $msg = "hello"; > > $msg = "<".$msg.">"; > > > > this doesn't work at all... i would like $msg to be <hello>, but i end up > > getting an empty string. > > > > neither does "<<".$msg.">>" or > > "\<".$msg."\>" work... > > > > i'm stumped, any ideas? > > Works fine. But if you echo that to a browser, it'll parse <hello> as a > tag and display nothing. (Hint: Viewing the html source when debugging is > almost always useful) > > If you want to display '<hello>' in a browser, you'd need to use &lt; > and > &gt; instead of < and >. > > $msg = 'hello'; > $msg = "&lt;$msg&gt;"; > > Matt > > > > -- > 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 (#18180) next »