Associative Array Example in PHP

Associative Array Example in PHP

July 29, 2023
<?php

$data = array(
    'name'=>"John Doe",
    'age'=>20,
    "company_name"=> "XYZ"
);

echo $data['name']. "\n";
echo $data['age']. "\n";
echo $data['company_name']. "\n"; 

?>

Output:

$ php associative_array.php
John Doe
20
XYZ

 

Leave A Comment

Avada Programmer

Hello! We are a group of skilled developers and programmers.

Hello! We are a group of skilled developers and programmers.

We have experience in working with different platforms, systems, and devices to create products that are compatible and accessible.