Answers for "insert key-value pair into array php"

PHP
1

insert key-value pair into array php

// If you are creating new array then try this :
$arr = array("key" => "value");

// And if array is already created then try this :
$arr["key"] = "value";
Posted by: Guest on April-28-2020
0

add key value array php

// laravel

use Illuminate\Support\Arr;

$array = Arr::add(['name' => 'Desk'], 'price', 100);

// or this one:
  
  
$array = Arr::add($array, 'price', 100);
Posted by: Guest on July-12-2021
0

php array push key value

<?php
$image[0] = $image[0].','.$filename;
?>
Posted by: Guest on October-21-2020

Code answers related to "insert key-value pair into array php"

Browse Popular Code Answers by Language