Home >Backend Development >PHP Tutorial >Examples of usage of foreach statement in php array

Examples of usage of foreach statement in php array

WBOY
WBOYOriginal
2016-07-25 08:59:17963browse
  1. $arr=array("one","two","three","four");
  2. foreach ($arr as $value){
  3. echo $value."< br>";
  4. }
  5. ?>
Copy code

Output results one two three four

For the usage of foreach, please refer to: http://bbs.it-home.org/w3school/php/php_looping.html.



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