I am trying to add the int with strings in PHP but I could get a helpful answer on StackOverflow and other website communities.
I want the code separate the ALPHABETS and NUMBER and then add the value in NUMBER and again JOIN the ALPHABETS AND ADDED NUMBER together.
How I achieve this, Please help.
Example:
$mynumber = 'SBI0001';
$addValue = '1';
It will be 'SBI0002' in PHP.
001preg_match("/(\\d+)([0-9]+)/", "MFG001", $matches); $string = $matches[1]; $number = $matches[2]; echo $number;1) to an string (001): Workflow: 1) find your number | 2) count the zeros e.g.:preg_match_all('/(0*)1/', $original_input, $output_array);| 3) rebuild your string =string+zeros*x+newValue