<?php

$texto = "A0001";
$novotexto = substr($texto, -4);
echo $soma = 'A'.str_pad(($novotexto+1), 4, '0', STR_PAD_LEFT);

