PHP 数组 去空后重新从 0 开始索引
<?php $gallery = '|||http://oss.xiaoguan.net/web/202003/oLhfEWk0hlGD44RNQZn4.png-fapai|||http://oss.xiaoguan.net/web/202003/HW0MnvmL70htVyB2Cmg6.png-fapai'; $arr = explode("|||",$gallery); $arr = array_merge(array_filter($arr)); if($arr[0]){ echo $arr[0]; }else{ echo '/assets/img/skin/img/defaultImg.png'; } ?>