У меня есть этот код прямо здесь. Я пытаюсь разобрать все заголовки из https://www.imdb.com/search/title/?genres=action
, но выдает ошибку об curl
Примечание: неопределенная переменная: curl в C: \ xampp \ Folder Xampp \ htdocs \ phplessons \ FILE \ Regex \ Regex parse. php в строке 4
Предупреждение: curl_setopt () ожидает, что параметр 1 будет ресурсом, значение NULL указано в C: \ xampp \ Folder Xampp \ htdocs \ phplessons \ FILE \ Regex \ Разбор регулярных выражений. php в строке 4
Примечание: неопределенная переменная: curl in C: \ xampp \ Folder Xampp \ htdocs \ phplessons \ FILE \ Regex \ Regex parse. php в строке 5
Предупреждение: curl_setopt () ожидает, что параметр 1 является ресурсом, значение NULL указано в C: \ xampp \ Folder Xampp \ htdocs \ phplessons \ FILE \ Regex \ Regex parse. php в строке 5
Примечание: неопределенная переменная: curl in C: \ xampp \ Folder Xampp \ htdocs \ phplessons \ FILE \ Regex \ Regex parse. php в строке 7
Предупреждение: curl_exe c ( ) ожидает, что параметр 1 является ресурсом, значение NULL указано в C: \ xampp \ Folder Xampp \ htdocs \ phplessons \ FILE \ Regex \ Regex parse. php в строке 7 Array ()
код здесь
$url="https://www.imdb.com/search/title/?genres=action&sort=runtime,asc&start=51&ref_=adv_nxt";
curl_setopt($curl, CURLOPT_URL, $url); //line 4
curl_setopt($curl ,CURLOPT_RETURNTRANSFER, true); //line 5
$result=curl_exec($curl); // line 7
$movies=array();
preg_match_all('!<a href="\/title\/.*?\/\?ref_=adv_li_tt"\n>(.*?)<\/a>!', $result, $match);
$movies['name']=$match[1];
print_r($movies['name']);die;