<?php $id = '5';$arr = array(5 => 'foo'); var_dump($arr[$id]);
Standard input is empty
string(3) "foo"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!