Page 1 of 1
How does &lang turn to 〈 ???
Posted: Sun Sep 25, 2005 9:18 pm
by ron_j_m
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
Posted: Sun Sep 25, 2005 9:21 pm
by Charles256
you might need to escape the & sign. try \&
Posted: Sun Sep 25, 2005 9:21 pm
by feyd
try single quotes
Posted: Sun Sep 25, 2005 9:21 pm
by Charles256
singles quotes would probably do it as well:)
Posted: Sun Sep 25, 2005 9:38 pm
by ron_j_m
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??
Posted: Sun Sep 25, 2005 9:58 pm
by feyd
oh.. I see what's happening.. use & instead of &
Posted: Sun Sep 25, 2005 10:17 pm
by ron_j_m
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
Posted: Sun Sep 25, 2005 10:26 pm
by Jenk
Posted: Sun Sep 25, 2005 11:21 pm
by pilau
If you're on Windows, use DzSoft PHP Editor. it has a list of the most common used HTML special characters.
Posted: Mon Sep 26, 2005 4:53 pm
by ron_j_m
Thanks thats what I was lookin for.
Wrench