Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I read a unicode url with PHP?

Tags:

php

unicode

get

I have a unicode url: \test.php?sText=Московский

I would like to use the $_Get function to work with the value of sText. The code I have for test.php is:

<?php
$sVar = $_GET['sText'];

echo "Variable = $sVar";
?>

Problem is that the above is coming bach as: Variable = ??????????

What do I need to do?

like image 209
SausageFingers Avatar asked Feb 16 '26 22:02

SausageFingers


1 Answers

This works fine for me:

$sVar = $_GET['sText'];

echo urldecode($sVar);
like image 102
ganji Avatar answered Feb 18 '26 11:02

ganji



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!