Php Array Get Key By Value
Hi guys,
Today i will explained to the search php array key by value through. This example is so easy to use in php. THis example to array_search() function to use.
Array_search() function is provides to the php. This function is used to array value through return the value key in php.
So let's start to the example and follow to the my all step.
Solution
array_search("laravel",$language);
Example :
This exampel to i will used to 4 key & value array create.
<?php
$language=array("a"=>"laravel", "b"=>"php", "c"=>"java", "d"=>"odo");
echo array_search("php",$language);
?>
Output :
b
So, finally we are done with our code we can get below output.
- 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