<?php $userdb = array( array( 'uid' => '100', 'name' => 'Sandra Shush', 'pic_square' => 'urlof100' ), array( 'uid' => '5465', 'name' => 'Stefanie Mcmohn', 'pic_square' => 'urlof100' ), array( 'uid' => '40489', 'name' => 'Michael', 'pic_square' => 'urlof40489' ) ); // uid will be key and name will be its value $temp = array_column($userdb, 'name','uid'); echo $temp[100];
You have javascript disabled. You will not be able to edit any code.