我目前试过这个:
$custom_image = usp_get_meta(false, 'usp-custom-4');
$custom_image = htmlspecialchars_decode($custom_image);
$custom_image = nl2br($custom_image);
$custom_image = preg_replace('/<br \/>/iU', '', $custom_image);
foreach($custom_image as $img) {
echo $img;
}
但是我得到了
警告:在......
中为foreach()提供的参数无效
答案 0 :(得分:1)
只是一个简单的假设来解决它:
更改
$custom_image = preg_replace('/<br \/>/iU', '', $custom_image);
要
$custom_image = explode('<br />',$custom_image);
然后你可以循环它。