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
1function lookup($array, $key) {
2
3 //loop through all values in array
4 foreach($array as $values) {
5
6 //if 'key' value matches `$key`, return 'value' value.
7 if($values['key'] == $key) {
8 return $values['value'];
9 }
10
11 }
12
13 //if nothing has been returned, return empty string
14 return "";
15}
16