The PHP website created by its users!
Home
»
PHP » foreach example
|
foreach example
| Author | |
| Description | An example of how the foreach() construct can be used. |
| Rating | (18 votes) |
PHP Code
<?php
$arr = array(1, 2, 3, 4);
foreach ($arr as &$value) {
$value = $value * 2;
}
?>
Comments
No comments posted yet.
|