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
ron_j_m
Forum Commoner
Posts: 35 Joined: Wed Feb 02, 2005 8:56 pm
Post
by ron_j_m » Sun Sep 25, 2005 9:18 pm
I have this "&lang" in a url i am passing and when echoed out it turns into" 〈"
Im sure thats probably what its supposed to do, but I need it to stop. Any Ideas?
example
Code: Select all
$data = ("test=yes&lang=us");
echo $data;
Any Ideas?
And why?
Thanks again..
Wrench
Charles256
DevNet Resident
Posts: 1375 Joined: Fri Sep 16, 2005 9:06 pm
Post
by Charles256 » Sun Sep 25, 2005 9:21 pm
you might need to escape the & sign. try \&
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sun Sep 25, 2005 9:21 pm
try single quotes
Charles256
DevNet Resident
Posts: 1375 Joined: Fri Sep 16, 2005 9:06 pm
Post
by Charles256 » Sun Sep 25, 2005 9:21 pm
singles quotes would probably do it as well:)
ron_j_m
Forum Commoner
Posts: 35 Joined: Wed Feb 02, 2005 8:56 pm
Post
by ron_j_m » Sun Sep 25, 2005 9:38 pm
man you guys are quick.
Ive tried escaping it and single quotes with no luck..
example
Code: Select all
$data = ('test=yes&lang=us');
echo $data;
Code: Select all
$data = ('test=yes\&lang=us');
echo $data;
any other ideas??
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sun Sep 25, 2005 9:58 pm
oh.. I see what's happening.. use & instead of &
ron_j_m
Forum Commoner
Posts: 35 Joined: Wed Feb 02, 2005 8:56 pm
Post
by ron_j_m » Sun Sep 25, 2005 10:17 pm
works perferct, thanks feyd.
I also found another work around usng htmlspecialchars() but not as clean as what you sugested..
Anyone know of a site that has all these special characters listed in one nice convenient spot?
Thanks again.
Wrench
Jenk
DevNet Master
Posts: 3587 Joined: Mon Sep 19, 2005 6:24 am
Location: London
Post
by Jenk » Sun Sep 25, 2005 10:26 pm
pilau
Forum Regular
Posts: 594 Joined: Sat Jul 09, 2005 10:22 am
Location: Israel
Post
by pilau » Sun Sep 25, 2005 11:21 pm
If you're on Windows, use DzSoft PHP Editor. it has a list of the most common used HTML special characters.
ron_j_m
Forum Commoner
Posts: 35 Joined: Wed Feb 02, 2005 8:56 pm
Post
by ron_j_m » Mon Sep 26, 2005 4:53 pm
Thanks thats what I was lookin for.
Wrench