I am trying to use number_format to format the data in an array, but I was unsuccessful with my attempts. This is the code I've been using, but I want to use number_format() since it is a currency field.
print("<tr><td>" . $row[0] . "</td>");
print("<td>" . $row[1] . " " . $row[2] . "</td>");
print("<td>" . $row[3] . "</td>");
print("<td>" . $row[4] . "</td>");
print("<td>$" . $row[5] . "</td></tr>");
I was given a suggestion like this:
print '$'.number_format(123.4,2);
How would I be able to format the array like that? I was trying something like this, but it wasn't working:
print("<td>" '$'.number_format($row[5]) "</td></tr>");
Any help or suggestions are appreciated.