Forum Moderators: coopster
$array = array('k1' => 'v1','k2' => 'v2','k3' => 'v3','k4' => 'v4');
how do i select the value that is provided BEFORE the key i provide
ex:
$mykey = "k2";
$array = array('k1' => 'v1','k2' => 'v2','k3' => 'v3','k4' => 'v4');
$value = somefunctions(); // gives the value v1
ex:
$mykey = "k4";
$array = array('k1' => 'v1','k2' => 'v2','k3' => 'v3','k4' => 'v4');
$value = somefunctions(); // gives the value v3
this is the last thing i do with the array, so if you have to cut pieces out it, its fine