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

Home >Backend Development >PHP Tutorial >多重循环下怎么防止变量超过数组索引

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

WBOY
WBOYOriginal
2016-06-13 10:29:031071browse

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

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)
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn