- var_dump: documentation ( source)
- ini_set: documentation ( source)
- strtolower: documentation ( source)
<?php
class CaseInsensitiveArray extends ArrayObject {
public function offsetExists($index)
{
return parent::offsetExists(strtolower($index));
}
public function offsetGet($index)
{
return parent::offsetGet(strtolower($index));
}
public function offsetSet($index, $newval)
{
parent::offsetSet(strtolower($index), $newval);
}
}
$test = new CaseInsensitiveArray;
$test['Location'] = 'test';
ini_set('error_reporting', E_ALL);
var_dump($test['location']);
var_dump($test['Location']);
var_dump(isset($test['location']));
var_dump(isset($test['Location']));