sandy1028 Posted October 9, 2009 Share Posted October 9, 2009 17, 1992/07/17/9207170469 18, 1989/08/18/8908161943 1988 SUNDAY, April 24, 1 were best friends.1988/04/24/Hello Out of this lines how to select only the string which is \d\d\d\d/\d\d/\d\d/string or \d\d\d\d/\d\d/\d\d/digits So the output should print 1992/07/17/9207170469 1989/08/18/8908161943 1988/04/24/Hello Link to comment https://forums.phpfreaks.com/topic/177100-select-from-line/ Share on other sites More sharing options...
mikesta707 Posted October 9, 2009 Share Posted October 9, 2009 I would look into regular expressions Link to comment https://forums.phpfreaks.com/topic/177100-select-from-line/#findComment-933759 Share on other sites More sharing options...
RussellReal Posted October 9, 2009 Share Posted October 9, 2009 <?php preg_match("/(\d{4}\/\d{2}\/\d{2}\/[^ ]*)/","a b c d 1988/04/24/Hello e f g",$match); print_r($match); ?> Link to comment https://forums.phpfreaks.com/topic/177100-select-from-line/#findComment-933766 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.