Associative array in php
<?php
/*
There are 3 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
This is the second one - Associative arrays
*/
$age = array("Samy"=>"35", "Naveen"=>"37", "Amit"=>"43");
echo "Mr.Samy is " . $age['Samy'] . " years old.";
?><?php
$associativeArray = [
"carOne" => "BMW",
"carTwo" => "VW",
"carThree" => "Mercedes"
];
echo $associativeArray["carTwo"] . " Is a german brand";
?>
Also in PHP:
- create seed in laravel
- cakephp login session
- check string contain symbol in php
- find specific word in string php
- check for substring in php
- not null in laravel
- file_get_contents() ssl operation failed
- '%r%i timeformat php
- carbon compare same date
- DATABASE CONNEC
- don't desplay error in php
- create array and remove duplicates php
- check like in string php
- check if substring in string php
- clear all caches laravel
- fillable vs guarded laravel
- captial functuon php
- check if string contain word
- Fatal error : Allowed memory size of 134217728 bytes exhausted
- api header php
- SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767
- error reporting off
- check if array value exists in another array php
- failed to open stream: no such file or directory php