Home  >  Article  >  Backend Development  >  php中foreach循环有关问题

php中foreach循环有关问题

WBOY
WBOYOriginal
2016-06-13 12:52:09788browse

php中foreach循环问题
我按着书本的例子,可是运行的时候提示错误
$arr = array("CRONALDO", "KAKA", "OZIL");
foreach($arr as $value)
{
each "Value: " . $value . "
";
}
提示这行 each "Value: " . $value . "
"; 出错,是什么原因呢?怎样才能正确输出


------解决方案--------------------
echo啊,低级错误
------解决方案--------------------
<br />
each "Value: " . $value . "<br>";//each换成echo<br />

------解决方案--------------------
引用:
我按着书本的例子,可是运行的时候提示错误
$arr = array("CRONALDO", "KAKA", "OZIL");
foreach($arr as $value)
{
each "Value: " . $value . "
";
}
提示这行 each "Value: " . $value . "
"; 出错,是什么原因呢?怎样才能正确输……
代码改成:
$arr = array("CRONALDO", "KAKA", "OZIL");
foreach($arr as $value)
{
echo "Value: " . $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