Search
 
SCRIPT & CODE EXAMPLE
 

PHP

map associative array php0

$array = [
  'category1' => 'first category',
  'category2' => 'second category',
];
 
$new = array_map(function($key, $value) {
  return "{$key} => {$value}";
}, array_keys($array), $array);
Comment

PREVIOUS NEXT
Code Example
Php :: add class to body class wordpress 
Php :: laravel unsigned integer 
Php :: download html content from url php 
Php :: break and continue in laravel 
Php :: php remove leading zeros 
Php :: get month from database php 
Php :: create a modal livewire laravel 
Php :: session cakephp 
Php :: symfony call service in controller 
Php :: wordpress translate specific text php 
Php :: Regex For Iranian Phone Numbers 
Php :: wordpress exclude current post from loop 
Php :: crul in laravel 
Php :: take and skip in laravel 
Php :: hasone relation in laravel 
Php :: php remove and  
Php :: <a href="<?php echo base_url(); ?"somelink</a 
Php :: insert data in database using seeder in laravel 
Php :: hello world php 
Php :: laravel migrate specific table 
Php :: Type cast using double php 
Php :: php remove array element 
Php :: php redirect seconds 
Php :: wordpress escape string 
Php :: call model function in controller laravel 
Php :: php now 
Php :: register sidebar wordpress 
Php :: report simple error in php 
Php :: limited text show in laravel 
Php :: arrow function in php 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =