-1

how are you today..?

hi all...

I found something odds, and very tricky..

echo "&currency"; //return ¤cy

echo "&ethnic"; //return ðnic

Why is this happened..? its affected on URL query.

it seemed that the string is encoded ASCII, how to fix it..?

this is the loop.. tried to replace & to & amp ;

foreach($pars as $key => $val) $param .= "&".$key."=".$val;

but its having so many errors...

Thankyou.

Jin Sun
  • 47
  • 1
  • 7

1 Answers1

0

You can find this symbol here https://dev.w3.org/html5/html-author/charref.

Use urlencode() to solve your problem with URL query.

pylwalker
  • 83
  • 7
  • just a simple string, url already encoded but parameter query has changed, tried to replace with & in my function, its return many errors.. something like this... foreach($pars as $key => $val) $param .= "&".$key."=".$val; – Jin Sun Nov 23 '21 at 02:06
  • http_build_query not solve this.. – Jin Sun Nov 23 '21 at 02:24
  • 2
    `http_build_query()`, if used properly, absolutely **does** solve this. https://stackoverflow.com/a/62055171/2943403 – mickmackusa Nov 23 '21 at 02:28