php Programming Glossary: newurl
CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in http://stackoverflow.com/questions/10835255/curlopt-followlocation-cannot-be-activated-when-safe-mode-is-enabled-or-an-open else curl_setopt ch CURLOPT_FOLLOWLOCATION false if mr 0 newurl curl_getinfo ch CURLINFO_EFFECTIVE_URL rch curl_copy_handle.. true do curl_setopt rch CURLOPT_URL newurl header curl_exec rch if curl_errno rch code 0 else code.. 301 code 302 preg_match ' Location . n ' header matches newurl trim array_pop matches else code 0 while code mr curl_close..
How to get final URL after following HTTP redirections in pure PHP? http://stackoverflow.com/questions/3799134/how-to-get-final-url-after-following-http-redirections-in-pure-php array function get_all_redirects url redirects array while newurl get_redirect_url url if in_array newurl redirects break redirects.. array while newurl get_redirect_url url if in_array newurl redirects break redirects newurl url newurl return redirects.. url if in_array newurl redirects break redirects newurl url newurl return redirects get_final_url Gets the address that..
|