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
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 Â

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.