A syntax problem with PHP
PHP Code
$contents = file_get_contents ($url); if ((Preg_match_all ('/(
<><\ table="">
)/ius ', $contents, $match))) {$contents = $match [1][0];} else{ ( Preg_match_all ('/(
<><\ ol="">
)/ius ', $contents, $match)) [color= #FF0000] $contents = $match [1][0];[ /color]
<\>
} <\>
Red That line error:
Parse error:syntax error, unexpected t_variable in
I am this is to crawl part of the page information, the page has 2 kinds of framework, is the 2, so want to make a judgment, not the first frame of the regular to use the second kind of regular to intercept the page information.
But use the If else syntax to error.
Write these 2 regular PHP code separately, these 2 are correct, together is wrong. Don't know PHP very well, please help us.
------Solution--------------------
(Preg_match_all ('/( <\ ol> )/ius ', $contents, $match)) <== missing line terminator ";"
------Solution--------------------
The operation is put into the loop.
$contents = ";
while ($rows =mysql_fetch_array (mysql_query ("Select Pl_title from Pagelinks limit 1,10"))
{
$string = $rows [' Pl_title '];
$string 1=urlencode ($string);
$url = "http://localhost/index.php/". " $string 1 ";
$contents = file_get_contents ($url);
if ((Preg_match_all ('/( <\ table> <\ table> )/ius ', $contents, $match)))
{
$contents. = $match [1][0];
}
Else
{
(Preg_match_all ('/( <\ ol> )/ius ', $contents, $match));
$contents. = $match [1][0];
}
}
discussion
There is also a problem:
PHP code
if ($rows =mysql_fetch_array (mysql_query ("Select Pl_title from Pagelinks limit 1,10")) {
$string = $rows [' Pl_tit Le '];
$string 1=urlencode ($string);
}
Echo $string;
$url = "Htt ...
<\> <\> <\> <\>