I am new to php and I need help with a code that needs to extract the numbers from a string so that I can increment it then build the original string back.
The string that I want to extract the number from looks like this:
hr-0001
I want to extract 0001
then increment it to 0002
and put it back together so it would look like
hr-0002
You don’t actually need to use a regex for this; the
++(“increment”) operator handles strings in exactly the way that you need.