I have a problem where I have a string in a database such as:
$string = "this is a string with a number $12321 and another
number $1234512 and I'd like to add the commas in those numbers";
Can I use preg_replace to keep the string intact and add the appropriate commas into the numbers above?
I'd like to use:
$newstring = preg_replace($regexp, $replace, $string);
to make the final value of $string equal to:
this is a string with a number $12,321 and another
number $1,234,512 and I'd like to add the commas in those numbers
What do I use for the values for $regexp and $replace?
Thank you!
Jim