[php]косяк

Discussion in 'PHP' started by rubik-nerubik, 15 Jun 2009.

  1. rubik-nerubik

    rubik-nerubik Elder - Старейшина

    Joined:
    4 May 2007
    Messages:
    248
    Likes Received:
    9
    Reputations:
    -2
    PHP:
    <?
    error_reporting(0);
    $file file_get_contents('http://ipgeobase.ru'); 
    $start 'd-color:#FFFFCC;border:1px solid #A8A8A8;"> ';
    $end'<br><br><font color=red>Неправильно';
    preg_match_all('|' strtok($start,'%|%') . '(.*)' strtok($end,'%|%') . '|sU',$file,$found); 
    if(
    $found[1][0]) {  
          
    $eee.=found[1][0]; 
          
          } else { echo 
    ''; }
    ?>

    Вообщем код делает: заходит на http://ipgeobase.ru, потом копирует
    Ваш IP-адрес: 9xxxxxxxx
    Ваш город: xxxxxxx
    Ваш регион: xxxxxxxxxx область
    Ваш округ: Центральный

    и по идее должен присвоить переменной... вот вопрос... почему вылетает ошибка


    Parse error: parse error in z:\home\127.0.0.1\www\noxak\formed.php on line 7

    т.е. на $eee.=found[1][0]; вроде правильно указал...
     
  2. wildshaman

    wildshaman Elder - Старейшина

    Joined:
    16 Apr 2008
    Messages:
    478
    Likes Received:
    483
    Reputations:
    99
    $eee.=$found[1][0];
     
  3. rubik-nerubik

    rubik-nerubik Elder - Старейшина

    Joined:
    4 May 2007
    Messages:
    248
    Likes Received:
    9
    Reputations:
    -2
    п.с. если выводить это всё echo found[1][0]; то он выводит как надо.
     
  4. mailbrush

    mailbrush Well-Known Member

    Joined:
    24 Jun 2008
    Messages:
    1,997
    Likes Received:
    996
    Reputations:
    155
    Замени found на $found.
     
  5. wildshaman

    wildshaman Elder - Старейшина

    Joined:
    16 Apr 2008
    Messages:
    478
    Likes Received:
    483
    Reputations:
    99
    и вообще:
    PHP:
    <? 
    $file file_get_contents('http://ipgeobase.ru');  
    preg_match('|<div style="padding:10px;margin-top:4px;background-color:#FFFFCC;border:1px solid #A8A8A8;">(.*?)<br><br><font color=red>|is',$file,$found);  
    echo 
    $found[1];
    ?>