分割字符串求助~~!!!
有这么一坨字符串:
/xxxx/zzzz/vvvv/bbbb/default_head/user1.gif
/video/templates/templates/images/default_head/user2.gif
……
/xxxx/zzzz/vvvv/bbbb/default_(、本文来源gao@!dai!ma.com搞$$代^@码网*搞gaodaima代码head/user14.gif
我需要得到user后面 和 “.” 前面的数字啊 (如1,2,14)
——解决方案——————–
- PHP code
<?php$str='/xxxx/zzzz/vvvv/bbbb/default_head/user14.gif';preg_match('/(\d+)\.[^.]+/',$str,$match);echo $match[1];