echo "<br/>that will be" . " " . $pricetotal;
I need to add a uk "£" before the $pricetotal such that I see the following in the browser:
That will be £ 2.99
Just like that:
echo "<br/>that will be" . " £" . $pricetotal;
you can also use html entity:
echo "<br/>that will be £" . $pricetotal;
or
echo "<br/>that will be £" . $pricetotal;
You could use
echo "<br/>that will be" . " £" . $pricetotal;
or
echo "<br/>that will be" . " £" . $pricetotal;
You can either try like
echo "£";
Or even by character code you can try like
echo chr(163);
You can use the HTMLEntity
echo "<br/>that will be £" . $pricetotal;
Also make sure that your website is encoded with a multibyte charset which supports the £
char.
I suggest using UTF-8.
Include
<meta charset="utf-8">
in your <head>
tag of your HTML.
Both
echo "<br/>that will be" . " £" . $pricetotal;
and
echo "<br/>that will be £" . $pricetotal;
work but under the following strict conditions:
<meta charset="utf-8" />
What is really important is that whole html rendering chain should be utf-8 to allow you to control your character encoding and to avoid strange behaviors. It is also the case when using for instance mysql database. The database encoding should be in advance and planned to be utf-8. Otherwise, it becomes very complex to rectify the encoding problem.
that will be £" . $pricetotal;` ? – sevenseacat Mar 04 '14 at 09:11