How to Get Specific Key Value in PHP Array?
Hi Dev,
In this tutorial, I will show you how to get specific key values in a PHP array. you'll learn how to get values from the specific keys in the array. Here you will learn how to find values by specific keys in a PHP array. you will learn how to find specific key values in the array. you will do the following things how to get only values from the specific key in an array in PHP.
Today, I will let you know an example of how to get specific key values in a PHP array. We will look at examples of how to get values from the specific keys in the array. you will learn how to find values by specific keys in a PHP array. This tutorial will give you a simple example of how to find specific key values in the array.
Example:
index.php
<?php
$array = array('UK'=>'London','India'=>'Delhi','Japan'=>'Tokyo');
$key = $array['UK'];
echo "An item by key 'UK': {$key}\n";
?>
Output:
An item by key 'UK': London
I hope it could help you...
- How To Use Php Conditional Statement Example
- How to Check if String Contains Regex in PHP?
- PHP Array_column() Function Example
- PHP Generate List of Random Numbers Between 0 and 100 Example
- How to User Login with Facebook in PHP?
- How to Explode Every Character into Array Using PHP Example?
- PHP Form Validation Tutorial
- PHP Convert XML to JSON Example