1array_search ( mixed $needle , array $haystack , bool $strict = false ) : int|string|false
2
3<?php
4$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');
5
6$key = array_search('green', $array); // $key = 2;
7$key = array_search('red', $array); // $key = 1;
8?>
1$userdb=Array
2(
3 (0) => Array
4 (
5 (uid) => '100',
6 (name) => 'Sandra Shush',
7 (url) => 'urlof100'
8 ),
9
10 (1) => Array
11 (
12 (uid) => '5465',
13 (name) => 'Stefanie Mcmohn',
14 (pic_square) => 'urlof100'
15 ),
16
17 (2) => Array
18 (
19 (uid) => '40489',
20 (name) => 'Michael',
21 (pic_square) => 'urlof40489'
22 )
23);
24
25simply u can use this
26
27$key = array_search(40489, array_column($userdb, 'uid'));
1$array = [
2 'clothes' => 't-shirt',
3 'size' => 'medium',
4 'color' => 'blue',
5];
6
7extract($array);
8
9echo("$clothes $size $color"); // t-shirt medium blue
10