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.
Maybe this?
ini_set('user_agent', 'Mozilla/5.0');