I am having problems removing leading zeros. I am dealing with baseball batting averages, for example .309 or .280 and what I am getting is 0.309 and 0.280. From a previous post I used the following which partially worked:
print preg_replace("/\s0(.+?)\s*$/", "\1", $strSubject1);
This worked, except it also removed trailing zeros and averages like .280 ended up .28
Could someone help me to just remove the leading zeros? TIA
Rick Monroe
www.theoaklandathletics.com