array_combine

PHP 5, PHP 7, PHP 8
array_combine - Creates an array by using one array for keys and another for its values

Example #1 A simple array_combine example

Result: Array ( [green] => avocado [red] => apple [yellow] => banana )
PHP Version:


Example #2 of array_combine

PHP Version: