|
Posted by BootNic on 05/28/06 21:41
> "scole954387@gmail.com" <scole954387@gmail.com> wrote:
> news:1148783769.419269.149260@j73g2000cwa.googlegroups.com....
>
> Thanks for the reply.
>
> Actually, this is what I have:
>
> <a
> href=/exec/obidos/tg/browse/-/########/ref=br_bx_c_1_2/104-1330076-7765538>Various
> Text</a>
>
> Using a regular expression (for use with preg_match in PHP), how
> can I just pull out the numbers (##########)?
<?php
$mystring="<a href='http://www.amazon.com/exec/obidos/tg/browse/-/15324461/ref=br_bx_c_1_129/103-6750759-7559044'>some text</a>";
$reg="/\d+/";
preg_match($reg, $mystring, $matches);
print "Numbers are : {$matches[0]}";
?>
--
BootNic Sunday, May 28, 2006 2:41 PM
Have no fear of perfection - you'll never reach it.
*Salvador Dali*
Navigation:
[Reply to this message]
|