PHP 替换字符串中的某个字符或某段字符

2019-04-15 17:48发布

$str = “

ddddddddddddddddd



ddddddddddddddddd



ddddddddddddddddd

;

ddddddddddddddddd

;

”; $str2 = "/a/201901.jpg,/a/201902.jpg,/a/201903.jpg,/a/201904.jpg"; // $str3 = ""; // print_r(explode(",", $str2)); $array = explode(",", $str2); // $array3 = explode("

", $str); // $array2 = array(); $count = count($array); print_r($count); for ($i=0; $i < $count; $i++) { # code... $n = $i+1; // var_dump($array[$i]); $str3 = "