[ create a new paste ] login | about

Link: http://codepad.org/qGfe1jNC    [ raw code | output | fork ]

PHP, pasted on Dec 13:
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
$array = array(
  'zero',
  'one',
  'id' => 'three'
);

foreach ($array as $key => $value) {
  if ($key == "id") {
    echo "Key: ". $key .", value: ". $value ."\n";
  }
}
?>


Output:
1
2
Key: 0, value: zero
Key: id, value: three


Create a new paste based on this one


Comments: