Implicit Evaluation with PHP Archives: May 2006
·
1 May 2006
Accessing Multi-dimensional Array
This weekend, I got an email from a reader wondering how to access non-constant indices of a multidimensional array.
Given an HTML field like <input name=”users[username][email]” type=”text” />
He needed to know how to access it. After trying multiple things, the solution he found was:
$property = “[username][email]”;
$field = $_POST[”users”];
$result = eval (”$field$property;”);
The more obvious $result = […]

