Jump to content

strange results echoing '£'


Dragen

Recommended Posts

I'm getting a very strange result trying to echo a simple pound sign '£'.

Here's my code:

$currency = '£';
echo $currency;

For some reason it's outputting this:

£

With the Â...

I've tried this as well:

echo htmlentities($currency)

but I get the same result.. I've never had this problem before and it doesn't6 happen with any other symbols, could anyone suggest an answer?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/69577-strange-results-echoing-%C2%A3/
Share on other sites

yeah.. I don't get it.

it works fine if I use either:

£ or £

but I need to be able to use just the £ symbol, and convert it using htmlentities, because it's for other people to use who probably wont understand the codes for them.

 

It's a really strange result though...

 

EDIT: If I use htmlentities on it and view the source it outputs:

£

Just can't figure out why it's adding the Â

just realised it's not limited to outputting with php... I tried putting £ on the page outside of <?php tags and the same thing happens.

 

Can't be the text editor.. I'm using dreamweaver, which has never given a problem like that before.

It also seems to be only on this one file for some reason..

actually.. it is happenning on other files...

 

All I've got on this file now is this:

<?php
$currency = '£';
echo $currency;
?>

and I'm still getting:

£

 

hmmm.. for some reason it's changed my £ sign in my code up their to the ascii, but it should be the £ symbol.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.