Use the number_format(); function. This function takes four arguments:
number_format($number_formated, $decimal_places, $decimal_identifier, $thousands_separator);
so if you wanted to convert 1234.567 into 1,234.56 the function would look like this:
$number = "1234.567";
number_format($number, 2, ., ,);
if you want a dollar sign in from of is just use a print statement:
$formatted = number_format('1234.567', '2', '.', ',');
Print ("\$ $formatted");
I hope this helps. I got this information for this book called "PHP developers cookbook" I use it everyday, and it's a great reference.