fotobleu Posted March 16, 2011 Share Posted March 16, 2011 hello php masters im trying to do this, and my head has no hair left ;( $res = preg_grep('/[0-9]*$/',array('foto_1','foto_45')); $res does not contain a array full of numbers ??? has anyone run across this before? thanks -danny Link to comment https://forums.phpfreaks.com/topic/230856-preg_grep-doesnt-work-for-regexing-nr-from-array-of-strings/ Share on other sites More sharing options...
fotobleu Posted March 16, 2011 Author Share Posted March 16, 2011 apparently i misunderstood the documentation, and "preg_grep" is not supposed to return just the matched parts but returns all the lines that the regex match occurs in, oops Link to comment https://forums.phpfreaks.com/topic/230856-preg_grep-doesnt-work-for-regexing-nr-from-array-of-strings/#findComment-1188425 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.