Home >Backend Development >PHP Tutorial >为什么数组不会替换?

为什么数组不会替换?

WBOY
WBOYOriginal
2016-06-23 14:11:47890browse

本帖最后由 KL998877321 于 2013-05-31 10:23:30 编辑

这样写简单好多。
$arr=array(3,4,5);
print_r($arr);
//输出345
echo "
";
$arr=array(3);
print_r($arr);
//输出3
?>
不是应该第二个结果应该也是3,4,5?

回复讨论(解决方案)

$arr=array(3,4,5);
$arr=array(3); //你都把内容全都换了

$arr=array(3,4,5);
$arr=array(3); //你都把内容全都换了
谢了,不知道自己想到哪里去了。

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