Jump to content

Duplicated entries in array


EagerWolf

Recommended Posts

You can't duplicate keys

 


<?php
$a = array (
     'a' => 1,
     'b' => 2,
     'c' => 3,
     'b' => 4,                 // overwrites earlier key
     'd' => 5
);

echo '<pre>', print_r($a, true), '</pre>';
?>

Archived

This topic is now archived and is 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.