Development Tips
Tricks & Tips to do things in Software Development
Friday, June 11, 2010
Array refer - foreach
This is a good way to go through arrays in php. We do not want to know about array size or is it empty.We can do this for object arrays too.
Syntax:
foreach($array as $variable)
{
//your code
}
Example:
$simple_array=Array('One','Two','Three');
foreach($simple_array as $point)
{
echo $point."
";
}
?>
Output of the code:
One
Two
Three
Have fun with this. eeeeesY
No comments:
Post a Comment
Newer Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment