I have a record in my BD MySQL, example: A0001
and I need to get this value and add example A0001
+ 1
= A0002
.
I've done the following:
$texto = "A0001";
$novotexto = substr($texto, -4);
$soma = ($novotexto+1);
echo $soma;
Return was A2
, but I'd like it to be A0002
.