Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 321 Bytes

destructure-named-array-values.md

File metadata and controls

11 lines (8 loc) · 321 Bytes

Destructure named array values in PHP

To destructure a value value from a named array, use this syntax:

$arr = ["ID" => 3];
["ID" => $id] = $arr; 
echo $id; // 3

See this post for variations. Also, see extract.