Here is my code:
$url = "http://localhost/myweb/qanda/1/";
var_dump(filter_var($url, FILTER_VALIDATE_URL));
//=> string(31) "http://localhost/myweb/qanda/1/"
It is known as a valid URL and all fine. But my code doesn't work when there is a Persian character in the URL:
$url = "http://localhost/myweb/qanda/1/س";
var_dump(filter_var($url, FILTER_VALIDATE_URL));
//=> bool(false)
Why? And how can I fix it?