伊谢尔伦2017-04-10 15:22:24
简单 正则搞定
<?php
$str = "abcde1234";
preg_match('/^(\w+)e(\d+)$/i',$str,$matches);
print_r ($matches);
Array
(
[0] => abcde1234
[1] => abcd
[2] => 1234
)
PHP中文网2017-04-10 15:22:24
explode()函数 http://www.w3school.com.cn/php/func_string_explode.asp
<?php
$str = "abcde1234";
print_r (explode("e",$str));
Array (
[0] => abcd
[1] => 1234
)
在线演示:http://3v4l.org/k7Dap