Jump to content

Recommended Posts

I don't think it has an officially official name, but it is indeed an assignment operator for arrays.

 

key => value

$names = array('Firstname' => 'John', 'Lastname' => 'Doe');

 

You can also use it in foreach loops to make use of the keys and values

 

foreach($array as $key => $val) {
   echo "key: $key  val: $val <br />";
}

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.