"test", "1" => "test1", "2" => "test2");$num = count($"/> "test", "1" => "test1", "2" => "test2");$num = count($">

首頁 >後端開發 >php教程 >多重循环下怎么防止变量超过数组索引

多重循环下怎么防止变量超过数组索引

WBOY
WBOY原創
2016-06-13 10:29:031078瀏覽

多重循环下如何防止变量超过数组索引

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->$arr = array(    "0" => "test",    "1" => "test1",    "2" => "test2");$num = count($arr);for($i=0;$i


------解决方案--------------------
foreach ($arr as $index => $value)
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn