fork download
  1. <?php
  2.  
  3. $texto = "A0001";
  4. $novotexto = substr($texto, -4);
  5. echo $soma = 'A'.str_pad(($novotexto+1), 4, '0', STR_PAD_LEFT);
  6.  
  7.  
Success #stdin #stdout 0.02s 23804KB
stdin
Standard input is empty
stdout
A0002