0

I have DB with Url's. For example, my url is

https://besplatka.ua/?prop[161][from]=1&prop[161][to]=3&prop[136][to]=20000&currency=USD

When i use this PHP code

$result = mysqli_query($mysqli, "SELECT url FROM urls WHERE id=5");
while($res = mysqli_fetch_array($result))
{
 $my_url=$res['url'];
}
echo $my_url;

I see that the php page does not display the correct value. Encoding everywhere is UTF-8.

https://besplatka.ua/?prop[161][from]=1&prop[161][to]=3&prop[136][to]=20000¤cy=USD 

What does this symbol ¤ mean? How do I fix the error?

user2219963
  • 1,741
  • 2
  • 11
  • 12

1 Answers1

1

After some search and try I found that the error is not about encoding UTF8 but the & symbol with curren word become this ¤.

(To get information about symbols: https://dev.w3.org/html5/html-author/charref)

So you can fix this by using urlencode function or just put your variable on the first of URL.

Result: https://besplatka.ua/?currency=USD&prop[161][from]=1&prop[161][to]=3&prop[136][to]=20000

I hope that can help you.

sayou
  • 893
  • 8
  • 29