Apr 8, 2003 #1 buzzt Programmer Joined Oct 17, 2002 Messages 171 Location CA I need to strip a link like http://test.atest.com/link01.asf down to just the number (01) value. What's the best approach?
I need to strip a link like http://test.atest.com/link01.asf down to just the number (01) value. What's the best approach?
Apr 8, 2003 #2 sleipnir214 Programmer Joined May 6, 2002 Messages 15,350 Location US I'd use preg_replace(): $foo = preg_replace ('/[^\d]*(\d+)[^\d]*/', '$1', $foo); Want the best answers? Ask the best questions: http://www.catb.org/~esr/faqs/smart-questions.htmlTANSTAAFL! Upvote 0 Downvote
I'd use preg_replace(): $foo = preg_replace ('/[^\d]*(\d+)[^\d]*/', '$1', $foo); Want the best answers? Ask the best questions: http://www.catb.org/~esr/faqs/smart-questions.htmlTANSTAAFL!