foreach loop in php
Syntax
foreach (array as value) { code to be executed; }
<?php
$arr = array( 10, 20, 3, 40, 150); foreach( $arr as $value ) { echo " $value <br />"; }
//
$lang = array('php','java','c','c#','.net','perl');
echo "Your output here <br>";
foreach( $lang as $val ) { echo " $val <br />"; }
No comments:
Post a Comment