PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
jkashu
Forum Commoner
Posts: 45 Joined: Tue Jan 30, 2007 12:00 pm
Post
by jkashu » Tue Aug 07, 2007 9:31 pm
I know this is something really easy that I'm forgetting, but how do I use a $ in a string without it being read as a variable?
<?
$var = "<? $page = gallery.php; ?>";
?>
The $var needs to be exactly what's in there without replacing the $page with something else.
Thanks!
VladSun
DevNet Master
Posts: 4313 Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria
Post
by VladSun » Tue Aug 07, 2007 9:32 pm
Single quotes?
There are 10 types of people in this world, those who understand binary and those who don't
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Tue Aug 07, 2007 9:46 pm
VladSun wrote: Single quotes?
Are you refering to my reply or the question?
VladSun
DevNet Master
Posts: 4313 Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria
Post
by VladSun » Tue Aug 07, 2007 9:48 pm
Jcart PostPosted: Tue Aug 07, 2007 9:32 pm
VladSun PostPosted: Tue Aug 07, 2007 9:32 pm
Reply to the OP
There are 10 types of people in this world, those who understand binary and those who don't
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Tue Aug 07, 2007 9:49 pm
VladSun wrote: Jcart PostPosted: Tue Aug 07, 2007 9:32 pm
VladSun PostPosted: Tue Aug 07, 2007 9:32 pm
Reply to the OP
Never know.. maybe you are quick on the draw?
VladSun
DevNet Master
Posts: 4313 Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria
Post
by VladSun » Tue Aug 07, 2007 9:55 pm
It is obvious that you were quicker ... this time
There are 10 types of people in this world, those who understand binary and those who don't
ghadacr
Forum Contributor
Posts: 135 Joined: Fri May 11, 2007 10:44 am
Post
by ghadacr » Wed Aug 08, 2007 6:57 am
Code: Select all
$page = "gallery.php";
$var = '$page';
superdezign
DevNet Master
Posts: 4135 Joined: Sat Jan 20, 2007 11:06 pm
Post
by superdezign » Wed Aug 08, 2007 8:24 am
You can also escape the character.