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>";
Était-ce utile?

La 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>";

Autres conseils

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>";
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top