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) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -