LinuxQuestions.org
Visit Jeremy's Blog.
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 01-30-2006, 12:43 PM   #1
richlawson
LQ Newbie
 
Registered: Jun 2003
Posts: 22

Rep: Reputation: 15
£ symbol and PHP


Hi there,

Not sure if this is the correct section for this question so apologise if it's not.

I've just started out trying to learn PHP and have ran in to an annoying problem. Everytime I enter a '£' symbol in either nano or vi I get this '£'? When the page is viewed via a browser with this symbol present as the wanted '£' symbol I get a black diamond??

Anyone know what the problem is? I'm running fedora core 4 with php 5.0.5-2.1.

Thanks in advance
 
Old 01-30-2006, 12:59 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
I don't know about vi, but PHP create HTML and in HTML the more correct way to enter such symbols is to use:
Code:
&pound
That will solve the problem with vi as well (for now...
 
Old 01-30-2006, 05:45 PM   #3
richlawson
LQ Newbie
 
Registered: Jun 2003
Posts: 22

Original Poster
Rep: Reputation: 15
Thanks for the response Hko, that workaround is great.

I've done a bit more digging and it appears that the problem i'm experiencing isn't with my linux + php setup as this fault only occurs when I SSH to the box using putty. I access the box via SSH mostly and hardly ever log on localy.

So I guess this thread is in the wrong section, Mods please could you move somewhere morte appropriate

thanks
 
Old 01-30-2006, 10:22 PM   #4
matthalliday
Member
 
Registered: Jan 2006
Location: Brisbane, Australia
Distribution: Suse, Mandrake, IPCop, Debian, Slackware
Posts: 34

Rep: Reputation: 15
That sort of thing has happened to me before. The problem for me was at I didn't choose the correct keyboard when installing linux.

Just check, maybe that is the problem.
 
Old 01-31-2006, 11:10 AM   #5
richlawson
LQ Newbie
 
Registered: Jun 2003
Posts: 22

Original Poster
Rep: Reputation: 15
Can't seem to resolve the issue with SSH client but i'm not to fussed to be honest.
Question about the answer Hko gave. How can i get the £ sign next to a variable without a space? I can only get echo statement to print '£ 100' I.E. "&pound $var" if i try to remove the space with "&pound$var" it prints exactly that.
 
Old 01-31-2006, 02:44 PM   #6
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
How about:

PHP Code:
echo "&pound".$var
 
Old 01-31-2006, 02:47 PM   #7
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Just thought... I think that the special characters should be terminated with a semicolon so maybe the following will also work

PHP Code:
echo "£$var"
 
Old 02-01-2006, 05:51 AM   #8
richlawson
LQ Newbie
 
Registered: Jun 2003
Posts: 22

Original Poster
Rep: Reputation: 15
Great stuff

Code:
echo "£$var";
works as needed using full stop gave same result as before.
Thanks a lot.
 
  


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
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM
PHP newbie having problems with £ symbol jimieee Programming 2 11-21-2003 01:52 PM
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 06:45 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