I'm using str_replace to replace the string '000' with ',000':
str_replace('000', ',000', $MYVAR)
So 1000 becomes 1,000. The problem is that 10000 becomes 1,0000 but I want it to become 10,000. How can I make str_replace parse from the right to the left, rather than the default left to right?
In an additional I need to remove any occurrences of '.00'. so '1.00' should become '1'. 10000.00 should become '10,000'.