PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $array = array('a'=>'apple', 'b'=>'banana', '42'=>'pear', 'd'=>'orange'); $index = 2; $elem = array_slice($array, $index, 1, true); $key = key($elem); $value = reset($elem); echo "Key: $key, value: $value";
Show:  
Copy Clear