Jump to content

[SOLVED] Basic array key question


php_joe

Recommended Posts

Even if numeric they are not the same.

 

<?php
$a = array();

$a[010] = 'Hello';
$a[10] = 'World';

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

?>

-->

Array
(
    [8] => Hello              // 010 is octal for 8
    [10] => World
)


[/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.