array_values and array_keys
Posted: Sun Mar 05, 2006 7:34 am
i have a array like this:
if i want to echo the value2, im doing this
its make me a real bit confuse how can i do a echo directly without first put the array in $var ??
Code: Select all
<?
$array = array (
'1' => 'value1',
'2' => 'value2'
);
?>Code: Select all
$var = array_values($array);
echo $var[1];its make me a real bit confuse how can i do a echo directly without first put the array in $var ??