Answer the question
In order to leave comments, you need to log in
Doesn't display the entire result of the cycle (PHP), why?
There is a loop looking for links to pages, but according to the criteria, the listing is below
function web_post($ind = null, $params = null){
$content = post_get('http://habrahabr.ru');
preg_match_all('/<div class="web_http(.*?)\>/s', $content, $url);
$x = '1';
while($x <= $ind){
preg_match('/data-type="(.*?)\_/', $url[1][$x], $url_k);
if($params == 1){
if($type[1]=='poster'){
preg_match('/ poster(.*?)\"/', $url[1][$x], $url_one);
$result = $url_one[1];
$x++;
}
}else{
preg_match('/ web(.*?)\"/', $url[1][$x], $url_two);
$result = $url_two[1];
$x++;
}
echo result;
}
}
web_post(5, 1);
Answer the question
In order to leave comments, you need to log in
when specifying parameter 1 in the web_post function, the page is loaded for a long time
if ($type[1]=='poster')
, $x
does not increase, and everything goes in cycles.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question