Answer the question
In order to leave comments, you need to log in
What did I miss (Simple HTML DOM Parser)?
1. There is a file with urls.
2. I want to loop through the elements of the array (that is, through the URLs). That doesn't work.$array = file(file.txt');
foreach($array as $url)
{
if(!empty($url))
{
$html = _curl($url); // возвращает страницу плюс оборачивает результат в функцию str_get_html()
echo $html; // должна вывестись первая страница из файла
exit;
}
}
$array = file('file.txt');
$html = _curl('site.ru/product/1/');
echo $html->find('span.price-new',0)->plaintext; // выводит цену товара
$array = file('file.txt');
$html = _curl($array[0]);
echo $html->find('span.price-new',0)->plaintext;
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