Answer the question
In order to leave comments, you need to log in
How to highlight the right words in any application?
Are there any applications for highlighting given words on the screen, regardless of the application in which they occur?
I met a program for copying text or contextual translation from any application, so I thought - maybe there is one too.
Answer the question
In order to leave comments, you need to log in
Perhaps the site looks for the presence of certain HTTP headers, for example, for a non-empty user-agent or some other headers.
To set them, curl is not necessarily needed (but I recommend it), you can do this for file_get_contents as well.
Example below is setting Accept-language and User-Agent
$options = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-Language: en-US,en;q=0.9,ru;q=0.8\r\n".
"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.50 Safari/537.36 OPR/65.0.3467.16 (Edition beta)\r\n"
)
);
$context = stream_context_create($options);
$String = file_get_contents($url, false, $context);
Turn on error output and see what happens there.
error_reporting(E_ALL);
ini_set('display_startup_errors', 1);
ini_set('display_errors', '1');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question