<?php echo $value['homa'] ?>
15018903588-006
在中间有一横杠,怎么根据中间的横杠前面数据截出,然后在根据横杠把后面的数据截出
求大虾代码贴出
------解决方案--------------------
判断工号是否有“-”
if (strpos($value['homa'],'-')){
$last = substr($value['homa'],0,strrpos($value['homa'],'-'));
$next = substr(strstr($value['homa'],'-'),1);
}else{
$value['homa'];
}