Answers for "create associative array from array php"

PHP
1

php transform associative array to array

$array = array_values($array);
Posted by: Guest on June-14-2020
5

how to create an associative array in php

<?php
	$associativeArray = [
        "carOne" => "BMW",
        "carTwo" => "VW",
        "carThree" => "Mercedes"
    ];
    
    echo $associativeArray["carTwo"] . " Is a german brand";
?>
Posted by: Guest on February-18-2020
0

associative array php

// Associative Array in PHP

/******** ARRAY TYPES  ************************************************
There are basically 03 Types of array in php  
1. Indexed arrays          => Arrays with a numeric index
2. Associative arrays      => Arrays with named keys
3. Multidimensional arrays => Arrays containing one or more arrays
***********************************************************************/

//EXAMPLE
//This is the second one - Associative arrays

$age = array("Peter"=>"35", "Naveen"=>"37", "Amit"=>"43");
echo "Mr.Samy is " . $age['Peter'] . " years old.";
Posted by: Guest on March-05-2021
0

associative array in php

$age = array("Peter""35", "Ben""37", "Joe""43");
Posted by: Guest on February-23-2021

Code answers related to "create associative array from array php"

Browse Popular Code Answers by Language