Home > Article > Backend Development > How to Access Single Values in Multi-Dimensional PHP Arrays?
This multi-dimensional array is structured as an array containing another array within its [0] index. To access specific values within this structure, you need to navigate through the array using the appropriate indexes.
Obtaining Single Values:
The following examples demonstrate how to obtain single values from the provided array:
<code class="php">echo $myarray[0]['email']; // Output: [email protected] echo $myarray[0]['gender']; // Output: male</code>
Explanation:
By understanding the structure of your multi-dimensional array and utilizing the appropriate indexes, you can easily retrieve individual values.
The above is the detailed content of How to Access Single Values in Multi-Dimensional PHP Arrays?. For more information, please follow other related articles on the PHP Chinese website!