A syntax-related issue with PHP

Source: Internet
Author: User
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 ...
  • <\> <\> <\> <\>

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.