Question

I am trying to echo my price field but I need a £ symbol before it, I have tried adding it to this line of code but i keep getting errors, help please!

  echo "<td>" . $row['price'] . "</td>";
Was it helpful?

Solution

Try this"

echo "<td>" . $row['price'] . "£</td>";

Or instead of £ with HTML output you can always write

&pound;

like this:

echo "<td>&pound;". $row['price'] . "</td>";

OTHER TIPS

echo "<td> £" . $row['price'] . "</td>";

You could add as well to get a standard amount with a comma seperating thousands

  "<td> £" . number_format( $row['price']) . "</td>";
echo "<td> &pound;" . $row['price'] . "</td>";
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top