Guest User

Untitled

a guest
Nov 18th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. <?php
  2. $ar = array("A" => "one", "B" => "two", "C" => "three");
  3. foreach($ar as $a){
  4. echo "key: ".key($ar)." value: ".$a."n";
  5. $ignore = next($ar);//separate key advancement - undesirable
  6. }
  7. ?>
  8.  
  9. $ar = array("A" => "one", "B" => "two", "C" => "three");
  10. foreach ($ar as $key => $value) {
  11. print $key . ' => ' . $value . PHP_EOL;
  12. }
Add Comment
Please, Sign In to add comment