array_combine function in php
/* Array_combine is inbuilt function in php, which is use to combine two array in key value pair */
/* make sure both array should be of same length */
<?php
$fname=array("Peter","Ben","Joe");
$age=array("35","37","43");
$c=array_combine($fname,$age);
print_r($c);
?>
/*
Output:
Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
*/
/*
I hope it will help you.
Namaste
Stay home stay safe
*/
Also in PHP:
- Warning: file_get_contents(): SSL operation failed with code 1
- cache out en laravel
- buat table seeder laravel
- 12th December 2020 date format in php
- Illuminate\Contracts\Container\BindingResolutionException Target class [HomeController] does not exist.
- current date() in php
- dynamic carousel bootstrap php
- add 10 days to date in php
- check where key in associative array have a value
- 12:30 am time format validation in laravel
- filter_var filter_validate_url
- check if a text include a word php
- create database backup programmatically php
- find a specific word in a string and add another string after that specific word php
- change format date usa month text php
- check in string is part oof other string php
- encode image to base64 in php
- current date time in php from format
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 20480 bytes) in phar:///usr/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php on line 64
- day in php time
- data time on php
- check if value exists in array key php
- date'G')
- Modularizing laravel 8.0