Array
(
[0] => /dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50e9c339938f7f013cc1170a321f6458.jpg::::::/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50e9c339938f7f013cc1170a321f6458.jpg::::::
[1] => /dgcms/d/file/product/yysj/gdjcpt/2015-02-15/71d522fdc9305d0d6f4cc6735e8035c4.jpg::::::/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/71d522fdc9305d0d6f4cc6735e8035c4.jpg::::::
[2] => /dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50700eff01cc0fd13fdbfe8cc0863222.jpg::::::/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50700eff01cc0fd13fdbfe8cc0863222.jpg::::::
)
我只想循环出这个二维数组中的每一组数组中的第一个,
回复讨论(解决方案)
??是一???。
估?你是要??效果。
$arr = array( '/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50e9c339938f7f013cc1170a321f6458.jpg::::::/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50e9c339938f7f013cc1170a321f6458.jpg::::::', '/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/71d522fdc9305d0d6f4cc6735e8035c4.jpg::::::/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/71d522fdc9305d0d6f4cc6735e8035c4.jpg::::::', '/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50700eff01cc0fd13fdbfe8cc0863222.jpg::::::/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50700eff01cc0fd13fdbfe8cc0863222.jpg::::::');for($i=0,$len=count($arr); $i<$len; $i++){ $tmp = explode('::::::', $arr[$i]); echo $tmp[0].'
';} /dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50e9c339938f7f013cc1170a321f6458.jpg
/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/71d522fdc9305d0d6f4cc6735e8035c4.jpg
/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50700eff01cc0fd13fdbfe8cc0863222.jpg
??是一???。
估?你是要??效果。
$arr = array( '/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50e9c339938f7f013cc1170a321f6458.jpg::::::/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50e9c339938f7f013cc1170a321f6458.jpg::::::', '/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/71d522fdc9305d0d6f4cc6735e8035c4.jpg::::::/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/71d522fdc9305d0d6f4cc6735e8035c4.jpg::::::', '/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50700eff01cc0fd13fdbfe8cc0863222.jpg::::::/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50700eff01cc0fd13fdbfe8cc0863222.jpg::::::');for($i=0,$len=count($arr); $i<$len; $i++){ $tmp = explode('::::::', $arr[$i]); echo $tmp[0].'
';} /dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50e9c339938f7f013cc1170a321f6458.jpg
/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/71d522fdc9305d0d6f4cc6735e8035c4.jpg
/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50700eff01cc0fd13fdbfe8cc0863222.jpg
具体到实际问题
为啥我也是这样写的,只能输出一个图片呢
"; } echo $morpic;}?>
$rexp="rn";
??是一???。
估?你是要??效果。
$arr = array( '/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50e9c339938f7f013cc1170a321f6458.jpg::::::/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50e9c339938f7f013cc1170a321f6458.jpg::::::', '/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/71d522fdc9305d0d6f4cc6735e8035c4.jpg::::::/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/71d522fdc9305d0d6f4cc6735e8035c4.jpg::::::', '/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50700eff01cc0fd13fdbfe8cc0863222.jpg::::::/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50700eff01cc0fd13fdbfe8cc0863222.jpg::::::');for($i=0,$len=count($arr); $i<$len; $i++){ $tmp = explode('::::::', $arr[$i]); echo $tmp[0].'
';} /dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50e9c339938f7f013cc1170a321f6458.jpg
/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/71d522fdc9305d0d6f4cc6735e8035c4.jpg
/dgcms/d/file/product/yysj/gdjcpt/2015-02-15/50700eff01cc0fd13fdbfe8cc0863222.jpg
具体到实际问题
为啥我也是这样写的,只能输出一个图片呢
"; } echo $morpic;}?>
你的$rexp="rn"; 是$rexp="\r\n"; 吗? 用rn分割,你确定图片地址中不会出现 rn?