- var_dump: documentation ( source)
- uniqid: documentation ( source)
- is_numeric: documentation ( source)
- preg_match: documentation ( source)
- preg_replace: documentation ( source)
<?php
$my_key = uniqid("\x00");
if (preg_match('/[a-zA-Z]/', $my_key)) {
echo "key has alpha chars\n";
}
$my_key = preg_replace('/[a-zA-Z]/', "4", $my_key);
var_dump(is_numeric($my_key));
$var[$my_key] = TRUE;
foreach($var as $key => $val)
{
if ($key === $my_key) {
echo 'You got it right';
} else {
echo 'You got it wrong';
}
}