1
我怎麼能發現twoVal在位置1?陣列中的位置
$arr = array('Cool Viski' => array('oneVal' => '169304',
'twoVal' => '166678',
'threeVal' => '45134'));
我怎麼能發現twoVal在位置1?陣列中的位置
$arr = array('Cool Viski' => array('oneVal' => '169304',
'twoVal' => '166678',
'threeVal' => '45134'));
$position = array_search('twoVal', array_keys($arr['Cool Viski']));
嘗試array_keys希望它會幫助你
$searchValue = "twoVal";
$keys = array_keys($array, $searchValue);