Re: output the var $ name

From: Date: Tue, 27 Jun 2000 22:41:09 +0000
Subject: Re: output the var $ name
Groups: php.general 
Request: Send a blank email to php-general+get-3457@lists.php.net to get a copy of this message
Addressed to: "Matthew M. Boulter" <mboulter@uq.net.au> php-general@lists.php.net ** Reply to note from "Matthew M. Boulter" <mboulter@uq.net.au> Tue, 27 Jun 2000 18:11:49 +1000 > > Hiya! > > If I've got a variable declared like this: > > $foo = "bar"; > > and want the output to look like: > > "The variable $foo equals: bar" > > what would I do? > echo "The variable \$foo equals: $foo<BR>\n"; echo 'The variable $foo equals: ' . $foo . '<BR>\n"; echo 'The variable $foo equals: ', $foo, '<BR>\n"; echo( "The variable \$foo equals: $foo<BR>\n" ); print "The variable \$foo equals: $foo<BR>\n"; print 'The variable $foo equals: ' . $foo . '<BR>\n"; print( "The variable \$foo equals: $foo<BR>\n" ); ?> The variable $foo equals: <?=$foo?><BR> The variable $foo eqhals: <? echo $foo ?><BR> <? I'm sure there are others. Rick Widmer Internet Marketing Specialists www.developersdesk.com

« previous php.general (#3457) next »