"test", "1" => "test1", "2" => "test2");$num = count($"/> "test", "1" => "test1", "2" => "test2");$num = count($">
Home > Backend Development > PHP Tutorial > 多重循环下怎么防止变量超过数组索引

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

WBOY
Release: 2016-06-13 10:29:03
Original
1071 people have browsed it

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

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
Copy after login


------解决方案--------------------
foreach ($arr as $index => $value)
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template