PHP wordpress string formatting error
I have a bit of PHP where I want to store a URL in a string.
The code itself seems fine, but for some reason, when I use the characters $sectionId=
, it causes problems, in fact, it alters $sectionId=
and changes it to §ionId=
.
If I misspell it to $secionId
then it works fine.
The full url SHOULD be:
http://url.com/file.php?appKey=$appkey&storeId=$storeid§ionId=$sectionid&v=3
but when I do an echo $myURL;
on it, it gives me:
http://url.com/file.php?appKey=$appkey&storeId=$storeid§ionId=$sectionid&v=3
Notice the §ionId=
instead of $sectionId=
.
Can anyone help me with this? It seems like basic PHP, but I don't understand why it just doesnt like those 4开发者_开发百科 or 5 characters in a row!!
Thanks.
Are you echoing it right to HTML? Well, some over-helpful browsers will do character conversions without being asked explicitly to with a semicolon; all you need to do is run it through htmlentities
or replace all &
s with &
and it will display correctly.
精彩评论