- substr: documentation ( source)
- var_dump: documentation ( source)
- uniqid: documentation ( source)
- preg_replace: documentation ( source)
- strtolower: documentation ( source)
- range: documentation ( source)
<?php
$a = uniqid();
function getNumber($val) {
$lets = array();
foreach (range('a', 'z') as $let) {
$lets[] = ("'`" . $let . "`is'");
}
var_dump($lets);die();
$num = range(1, 26);
$val = strtolower($val);
$ret = preg_replace($lets, $num, $val);
$ret = substr($ret, 0, 10);
return $ret;
}
$b = getNumber($a);
echo "<pre>";
var_dump($b);