php - CURL did not returns any thing if the URL contains Special charters -


I want to get details from the URL while working fine for the normal character url but ami in one of the URLs Special characters like ' ³³ ' include

My URL sample is as follows:

  http://www.abc.com/aóvek -xyz-pqr / 1/8 /   

My php code is:

  $ ch = curl_init ($ my_url); curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ CH, CURLOPT_BINARYTRANSFER, true); $ Content = curl_exec ($ ch);    

Try with the following (taken from):

  $ encoded_url = preg_replace_callback ('#: // ([^ /] +) / ([^?] +) #', Function ($ match) {return ': //'. $ Match [1] ('/', Array_map ('crudelecode', explosion ('/', $ match [2])));}, $ my_url); $ Ch = curl_init ($ encoded_ril); curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, true); Curl_setopt ($ CH, CURLOPT_BINARYTRANSFER, true); $ Content = curl_exec ($ ch);    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -