1条回答 默认 最新
- douchuoliu4422 2019-02-06 18:07关注
If you want to only get the numbers, you could do a preg_match
$re = '/(\d+\/\d+)/s'; $str = 'dfsadsfadsfads~~9/10~~lfkjdskfds'; preg_match($re, $str, $matches);
but if you are able to get the entire doc as a single string, you could do a preg_match_all
$re = '/(\d+\/\d+)/s'; $str = 'dfsadsfadsfads~~9/10~~lfkjdskfds dfsadsfadsfads~~9/10~~lfkjdskfds '; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
then loop on the $matches
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报