How to convert a url to a browser like url? ( ...%20... )
- by Kaoukkos
I want to get data using CURL but I have a problem. When I set the url like this
$url = "https://graph.facebook.com/fql?q=SELECT name FROM page"; // continues
I do not have anything returned. When I copy the browser url, this is
$url = "https://graph.facebook.com/fql?q=SELECT%20name%20FROM%20page";
I get the results through CURL. I tried htmlentities and htmlspecialchars without luck.
What am I missing here?
$ch = curl_init($url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$content = curl_exec($ch);