concatenation - How to add A through Z at the end of a string PHP -
what doing taking vehicle vin number , taking last 6 digits of , storing stock number. issue have have function goes , checks database make sure stock number exists. if (can have same vehicle in inventory again buy back, etc) want concat @ end of sting through z.
if(strlen($vin) > 9) { $stocknum = substr($vin,-6); while(verfiyunique($mysqli, $stocknum) != true) { if(strlen($stocknum < 7)) { $stocknum = substr($vin,-6) . "a"; }else{ ? } } return $stocknum;
how increment lets b or b c if match?
thanks in advance help!
you increment ascii number , use chr()
function convert relevant character. e.g.: chr(65)
output a
see http://php.net/manual/en/function.chr.php more info link ascii table.
Comments
Post a Comment