Things You'll Need:
- PHP IDE or a text editor
- Web server (preferably Apache)
- MySQL database server, configured for work with PHP
- PHP 5
-
Step 1
Create the array:
$arr = array(1, 2, 3, 4); -
Step 2
Write the condition:
foreach ($arr as $i => $value) -
Step 3
Write the action to be performed. In this case, the action is to multiply the initial value by 10:
{
$arr[$i] = $value * 10;
} -
Step 1
Check your code for syntax errors.
-
Step 2
Make sure your array has the following values: 10, 20, 30, 40.











