PHPFront
Home
PHP Codes
Tutorials
Scripts
Submit Code
About
Home
>
PHP
> foreach example
The PHP website created by its users!
Search:
Most popular PHP codes
Latest 10
Submit Code
Photographic locations
Canberra web design
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
;
}
?>
Rate it:
5 - Excellent
4 -
3 - Not bad
2 -
1 - Poor
Print
Comments
No comments posted yet.
Name
Website
Your comment