Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ar = array("A" => "one", "B" => "two", "C" => "three");
- foreach($ar as $a){
- echo "key: ".key($ar)." value: ".$a."n";
- $ignore = next($ar);//separate key advancement - undesirable
- }
- ?>
- $ar = array("A" => "one", "B" => "two", "C" => "three");
- foreach ($ar as $key => $value) {
- print $key . ' => ' . $value . PHP_EOL;
- }
Add Comment
Please, Sign In to add comment