Answer the question
In order to leave comments, you need to log in
How to work with curl?
I want to parse products from a third-party site, I used file_get_content, the html of the page was returned, but I found out that there is a more correct way - curl, but the code below returns a 301 redirect, namely the text in the picture.
How to get the html of the page in such a way that you can use selectors, or at least in the form of an associative array?
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.vashidveri72.ru/catalog/dveri_vkhodnye');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
var_dump($output);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question