سؤال

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