I know. It's easy to install a user agent for curling, but my code is based on get_headers, by default the user_headers agent is empty. Thanks for any help.
Maybe this?
ini_set('user_agent', 'Mozilla/5.0');
get_headers indicates only the data sent by the server to the client (in this case, PHP), it does not indicate request headers.
If you are trying to find the user agent with which the get_headers request was made, you will need to use:
ini_get('user_agent');
For more documentation see the links below:
Source: https://habr.com/ru/post/1384946/More articles:Getting Error 403 (Forbidden) when sending an SSL request from Apache server to Tomcat - sslDDD - how to handle search related objects? - aggregateIs there a way to show the "lock" WinForms ContextMenu? - garbage-collectionCode-First with SQL Server Express; Operating System Error 2 - c #How to determine the type of object? - pointersLooking at selecting an indefinite number of lines in excel as part of a larger VBA macro - vbaSimple Messaging Options for .net Programs - .netHow can I join a view? - sqlSelenium WebDriver PageFactory FindsBy Using jQuery Selector? - jquery-selectorsPython script does not end properly - pythonAll Articles