remove leading zeros php skip leading string
I am very new to PHP.
I have fields returning from a database that are our stock numbers.
e.g. C000001204 and also GC00001204
I hope to remove the leading zeros but keep the prefix of C and GC. I do
not wish to remove the 0 in between the 2 and the 4.
I had a good search for this however I could only find solutions that
ltrim the start.
Thanks in advance!
Andy
No comments:
Post a Comment