<?php include('include/include.php'); if($_POST['type']==1) { $invoice = substr($_POST['invoice_value'],5); $value = (int) $invoice + 1; $val = sprintf('%05d', $value); $invoice_value = $_POST['Branch'].'-'.$val; echo $invoice_value; } ?>