<?php $in = "1234" ; $arr = array ( $in => "foobar" ); $keys = array_keys ( $arr ); $out = $keys [ 0 ]; var_dump ( $in == $out ); var_dump ( $in === $out );