PHP Classes

Adding £ to select option vlaue

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  Locating addresses on...  >  All threads  >  Adding £ to select option vlaue  >  (Un) Subscribe thread alerts  
Subject:Adding £ to select option vlaue
Summary:I get incorrect rendering for £ and £
Messages:4
Author:Nikos
Date:2008-02-23 13:00:25
Update:2008-02-27 10:06:42
 

  1. Adding £ to select option vlaue   Reply   Report abuse  
Picture of Nikos Nikos - 2008-02-23 13:00:25
Hello again, may I ask another question..

I want to display a series of prices in select form

if i use

<?php echo "<option value =\"price\">&pound;100</option>" ?>

to display them manually the £ renders fine but if I do this using the forms class

$form_reg->AddInput(array(
"TYPE"=>"select",
"NAME"=>"web_dev_budget",
"ID"=>"web_dev_budget",
"AutoWidthLimit"=>30,
"VALUE"=>"pick",
"OPTIONS"=>array(
"pick"=>"Budget",
"£500+"=>"&pound;500+",
"£1000+"=>"&pound;1000+",
"£2000+"=>"&pound;2000+",
"£3000+"=>"&pound;3000+"
),
"LABEL"=>"Budget"
));

I get incorrect rendering.

  2. Re: Adding £ to select option vlaue   Reply   Report abuse  
Picture of Nikos Nikos - 2008-02-23 19:45:40 - In reply to message 1 from Nikos
I wish to add that if I do something like this:

"£500+"=>"£500+"

I am getting Å£ where I should only see £.

Could it be something the class is doing?

  3. Re: Adding £ to select option vlaue   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-02-23 20:58:07 - In reply to message 2 from Nikos
It seems that you are omitting or defining the page character encoding as UTF-8 . If you pass the pound character as ISO-8859-1 or UTF-8 to the class, you must use the same encoding in the page and in the class character encoding.

Check the encoding that your PHP editor is saving.

  4. Re: Adding £ to select option vlaue   Reply   Report abuse  
Picture of Nikos Nikos - 2008-02-27 10:06:43 - In reply to message 3 from Manuel Lemos
Ok thanks for that. I'll check it out. I'm glad its nothing to do with your class.