Jump to content

Isolate 9 Consecutive Numbers from URL


LuisAngel

Recommended Posts

How do I extract 9 consecutive numbers from a URL like the following:

 

http://itunes.apple.com/us/app/redlaser/id312720263?mt=8

 

In this example, the desired extraction is 312720263

 

Will something like the following work?

 

<?

preg_match('/([0-9]{9})/', $alphanum, $matches);

$sequence = $matches[1];

?> 

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/198513-isolate-9-consecutive-numbers-from-url/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.