Re: Preg_match question
| From: | Jeroen Serpieters | Date: | Sat, 29 May 2004 11:59:59 +0000 |
| Subject: | Re: Preg_match question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-187187@lists.php.net to get a copy of this message | ||
On Sat, 29 May 2004, Dave Carrera wrote:
>
> Link returned = <a href="./somepage.php">Of to some page</a>
>
> The bit I want to play with is ./somepage.php.
>
$str = '<a href="./somepage.php">Of to some page</a>';
if( preg_match("/<a href=\"(.*)\">/Ui", $str, $matches) )
echo $matches[1];
else
echo "string didn't match";
--
Jeroen
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows
where you live.
-- Martin Golding