phpcurluser-agentget-headers

how to set user agent for get_headers PHP function


I know It's easy to set user agent for curl but my code is based on get_headers, by default get_headers user agent is empty. thanks for any help.


Solution

  • Maybe this?

    ini_set('user_agent', 'Mozilla/5.0');