Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // the same "$fruit" array with your own numbered keys
- $fruit = array(10=>'orange', 11=>'cherry', 12=>'lemon');
- // add the apple on #3
- $fruit[2] = 'apple'; // Note, the first array element has a zero as key
- foreach ($fruit as $key => $val) {
- echo "$key - $val<br>";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement