View Full Version : Printing Variables

12-21-2003, 08:29 PM
how do you print variable names rather then the content the variable contains?

12-21-2003, 09:39 PM
$str = "this is inside the variable";

echo $str.' $str';

If you have a variable inside single quotes, it won't parse (if that's the right word) :)

echo "$str";

will show "This is inside the variable"

echo '$str';

will show $str

12-22-2003, 03:23 PM
If you don't know the variable name (for example, you have a an array and are looping through it), it's impossible, but it's probably solvable another way. If Nightfire's method didn't solve your problems, post some code.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum