Associative Arrays

<?php
$person = [
"name" =&gt; "Ali",
"age" =&gt; 30,
"city" =&gt; "Karachi"
]; echo $person["name"]; // Ali ?>

Explanation:

  • Associative arrays use key-value pairs.
  • You can access values using their keys.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *