[PHP] Парсинг

Discussion in 'PHP' started by SPrivate, 10 Mar 2009.

  1. SPrivate

    SPrivate New Member

    Joined:
    26 Mar 2008
    Messages:
    0
    Likes Received:
    3
    Reputations:
    -5
    как пропарсить <li><a href='mail.php?9934'>Мои Сообщения (<b>9</b>)</a></li>
    и вывести число 9
     
  2. svesve

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

    Joined:
    15 Jun 2007
    Messages:
    574
    Likes Received:
    86
    Reputations:
    11
    PHP:
    $a="<li><a href='mail.php?9934'>Мои Сообщения (<b>9</b>)</a></li>";
    preg_match('#<b>(\d+)<\/b>#',$a,$out);
    echo 
    $out[1];
    примерно так )))