I cannot work out how to get the currency symbol?
At the moment I am using
setlocale(LC_MONETARY, 'en_GB');
money_format('%i', 1000);
Which give me the output
GBP1,000
But I want
£1,000
I have checked out the PHP manual but it isn’t that helpful.
Any ideas?
Incoming search terms:
- php money_format
- regex british pound sign
- php money_format uk pounds
- php money_format gbp
- php money_format â£
- ⣠php money_format
- php gbp symbol in regex
- money_format € sign
- money_format €
- la signe pound dans php
Related posts:
- If dealing with money in a float is bad, then why does money_format() do it? I’ve been waffling on how to deal with currency display and math in PHP, and...
- How to output abbreviated currency symbol instead of currency name when using money_format()? Is there a flag in the money_format function that lets you replace the long currency...
- What does the & sign mean in PHP? I was trying to find this answer on Google but I guess the symbol &...
- Advice on a Canadian SMS Gateway provider I am curious as how to how much trouble / money it would be for...
- Rupee symbol in mail I am using PHP mailer to send mails to my clients. I need to insert...
- How to solve â¬25.99 vs 25,99⬠preg_match problem? If I have these strings: $string1 = "This book costs €25.99 in our shop." and...
- Why does PHP have a $ sign in front of variables? In PHP and some other scripting languages have the $var syntax while Java and other...
- Letting users try your web app before sign-up: sessions or temp db? I’ve seen a few instances now where web applications are letting try them out without...
- Best way to implement Single-Sign-On with all major providers? I already did a lot of research on this topic and have implemented a lot...
- Regex failing when pattern involves dollar sign ($) I’m running into a bit of an issue when it comes to matching subpatterns that...






An easy solution could be te replace GBP with & pound ; (without the spaces) after the money_format.
Not familiar with the benefits of money_format, but I would just use number_format instead and just prepend the currency symbol to it.
Use str_replace() function is an option.
£ – British Pound –
£(163)Use str_replace() function is an option.
£ – British Pound –
£(163)