mancroft Posted March 17, 2007 Share Posted March 17, 2007 I have a list: fred harry43986.php jayne.php diana732 james and need to sort out the strings which end .php from those that don't. What's the RegEx for that? Thanks. Link to comment https://forums.phpfreaks.com/topic/43140-solved-strings-which-end-php/ Share on other sites More sharing options...
fert Posted March 17, 2007 Share Posted March 17, 2007 preg_match_all("/(.*)\.php/s",$subject,$matches); Link to comment https://forums.phpfreaks.com/topic/43140-solved-strings-which-end-php/#findComment-209500 Share on other sites More sharing options...
mancroft Posted March 17, 2007 Author Share Posted March 17, 2007 Thank you, fert. Link to comment https://forums.phpfreaks.com/topic/43140-solved-strings-which-end-php/#findComment-209504 Share on other sites More sharing options...
paul2463 Posted March 17, 2007 Share Posted March 17, 2007 if(ereg("\.php$" , $string)) { // what to do if true } Link to comment https://forums.phpfreaks.com/topic/43140-solved-strings-which-end-php/#findComment-209505 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.