daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Jan 4th, 2016 265 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // the same "$fruit" array with your own numbered keys
  2. $fruit = array(10=>'orange', 11=>'cherry', 12=>'lemon');
  3.  
  4. // add the apple on #3
  5. $fruit[2] = 'apple'; // Note, the first array element has a zero as key
  6.  
  7. foreach ($fruit as $key => $val) {
  8.     echo "$key - $val<br>";
  9. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top