LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-21-2003, 08:41 AM   #1
jimieee
Member
 
Registered: Aug 2003
Location: London, UK
Distribution: Debian and Fedora for play and RHEL + Solaris for work
Posts: 172

Rep: Reputation: 15
PHP newbie having problems with £ symbol


Hi I've only just started messing about in PHP, following tutorials and that. I'm having a little trouble correctly displaying the £ symbol. For example:

The php code:
echo 'Discount: £'.number_format($discount,2).' <br />';

displays something along the lines of:
Discount: £6.78

(I want it say Discount: £6.78)

I'm not sure exactly where to start finding out where the problem is - cos this is my first day of ever using php, or any other web scripting language for that matter! I'm guessing something to do with localisation settings in php.ini or something?

Regards,

James
 
Old 11-21-2003, 11:31 AM   #2
Tomasfuego
Member
 
Registered: Nov 2002
Location: USA
Distribution: Lenny at work
Posts: 168

Rep: Reputation: 30
You may try this out ... ( i've seen that before too, but its been a while )

echo 'Discount:&nbsp;£'.number_format($discount,2).' <br />';

basically you delete any keyboard spaces between discount and the pound symbol and use the HTML entity for the space, which if it doesnt apppear above, its> & n b s p ; < (of course, remove the spaces) Its really easy to memorize too. Every HTML entity ( is that the right name? ) starts with an amperand, and ends with a semicolon. nbsp stands for "Non-Breaking SPace" (or at least i think it does) ... www.w3schools.com is a good place to look up more of these things.

PHP is wonderful and I hope you enjoy it.

Last edited by Tomasfuego; 11-21-2003 at 11:32 AM.
 
Old 11-21-2003, 01:52 PM   #3
paonethestar
Member
 
Registered: Oct 2003
Posts: 47

Rep: Reputation: 16
Lightbulb

php code

<?php

print "Discount: &#163 NUM";

?>

put ur NUM there .put '\&\#163' in the place of above symbol as it is displaying as that symbol(don't include \'s in ur code).This will print ur symbol. Why don't u check prev threads before posting !.There was not similar but same quest in this form ,check if u want.

Last edited by paonethestar; 11-21-2003 at 01:57 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
snort failed: snort: symbol lookup error: undefined symbol: usmAES192PrivProtocol Emmanuel_uk Linux - Security 1 07-10-2005 10:29 AM
PHP+apache undefined symbol:unixd_config error Emist Linux - Newbie 13 03-15-2005 10:49 AM
slackware, apache and PHP from .tgz - problems with PHP szymon Slackware 2 09-06-2004 04:57 PM
Newbie and PHP david63 Linux - Newbie 3 05-08-2003 03:18 AM
Apache/PHP extension making. Unknown symbol _Unwind_Resume problem. TimeSaver Linux - Software 1 03-20-2003 05:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration