質問

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>";
役に立ちましたか?

解決

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

他のヒント

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>";
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top