N nws 29.05.2008 #1 29.05.2008 #1 Допустим есть страничка www.somepage.com На ней есть ссылки вида <a href=somepage.com/index.php> и <a href=anotherpage.com> Так как я не дружу с pcre помогите вытащить линки вида <a href=anotherpage.com>
Допустим есть страничка www.somepage.com На ней есть ссылки вида <a href=somepage.com/index.php> и <a href=anotherpage.com> Так как я не дружу с pcre помогите вытащить линки вида <a href=anotherpage.com>
D destr 30.05.2008 #2 30.05.2008 #2 Что-то типа этого. [codebox]<?php $str = file_get_contents('link.html'); preg_match_all("/<a.+?href=('|\")?(.+?)\\1.*?>(.+?)<\/a>/mis", $str, $matches); print_r($matches); ?>[/codebox]
Что-то типа этого. [codebox]<?php $str = file_get_contents('link.html'); preg_match_all("/<a.+?href=('|\")?(.+?)\\1.*?>(.+?)<\/a>/mis", $str, $matches); print_r($matches); ?>[/codebox]
N nws 30.05.2008 #3 30.05.2008 #3 destr Спасибо, только возник еще 1 вопросик: Как вытащить линки вида: href = view.php?id=[kakoi-to nomer] ^^ "/href=view+[.]+php+[?]+ad=\\d+/m"
destr Спасибо, только возник еще 1 вопросик: Как вытащить линки вида: href = view.php?id=[kakoi-to nomer] ^^ "/href=view+[.]+php+[?]+ad=\\d+/m"
D destr 01.06.2008 #4 01.06.2008 #4 Например, так. [codebox]<?php $str = "<a href='view.php?id=1234'>..</a>"; preg_match_all("/<a.+?href=('|\")?(view\.php\?id=\\d+)('|\")?.*?>(.+?)<\/a>/mis", $str, $matches); print_r($matches); ?> [/codebox]
Например, так. [codebox]<?php $str = "<a href='view.php?id=1234'>..</a>"; preg_match_all("/<a.+?href=('|\")?(view\.php\?id=\\d+)('|\")?.*?>(.+?)<\/a>/mis", $str, $matches); print_r($matches); ?> [/codebox]