|
Posted by Tom on 11/14/07 19:16
On Tue, 13 Nov 2007 16:34:18 +0100, artev wrote...
>
>I would like to extract a piece of string inner oneother;
>how rule for extraction all text inner this ">.......</a>
>
>
>example if I have this string
><li><a href="http://localhost/namesitos/index.php?pg=id=b8f">Title &
>Test</a></li>
>
>the code will return Title & Test
You can use preg_replace() similar to this...
<?php
$string = '<li><a href="http://localhost/namesitos/index.php?pg=id=b8f">Title
& Test</a></li>' ;
echo preg_replace('/<li><a href\=.+>(.+)<\/a>\<\/li>/', "$1", $string);
?>
Tom
--
NewsGuy Free Trial Accounts
Now a massive 20 Gigabytes of unrestricted downloads !
http://newsguy.com/
Navigation:
[Reply to this message]
|