Advertisement

09.04.2008 at 08:33AM PDT, ID: 23703045
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.9

Help with infuriating British Pound Sign

Asked by manicwaszoot in PHP and Databases, Hypertext Markup Language (HTML), MySQL Server

Tags:

Hi There,

I have issues with an email newsletter that is due to be sent.

I have to put in a £ sign in the text version and HTML version of my newsletter.

I have a database table with an introduction that reads


""
Welcome to the world of chinalife! Your one stop shop to looking and feeling better.

To help you ease into the changing season, we have dropped £5 into your online account for you to spend as you please on our range of beauty products, teas and tonics. Just visit our online shop and have a browse. Once you have added over £10 of exciting products into your basket, you can enter this discount code to receive a £5 credit: ommittedcode . Your code will expire at the end of September so don't forget to use it up!

Enjoy,

Don and Liselle
""

This mysql table is stored as
latin1_swedish_ci

The pages used to input the data via forms is encoded ISO-8859-1

When I display the data on my HTML page I use
$newtext = str_replace("£","£",$newtext);

To give the correct HTML version of the pound symbol.

However when I do this my page replaces the L character with the pound symbol and leaves the £ alone.

The same thing happens if I use htmlentities()

When it comes to the text version that is sent via email, outlook omits the pound sign and thunderbird shows a ? mark.  
So I tried to do the following to the text version:
$newtext = str_replace("£","GBP:",$newtext);

But again it replaces the letter L with GBP: and left the £ symbol alone.

Any help much appreciated as this is driving me nuts.

Kind Regards,
Matt

You can see the html output im having trouble with here -> http://www.chinalifeweb.com/news/newsletter2.php

http://www.chinalifeweb.com/news/newsletter2.php
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
function bb2html($text)
{
 
        $text = str_replace("\n",'[br]',$text);
 
//FORMAT BB CODE TO HTML
  $bbcode = array("<", ">",
                "[list]", "[*]", "[/list]", 
                "[img]", "[/img]", 
                "[b]", "[/b]", 
                "[u]", "[/u]", 
                "[i]", "[/i]",
                '[color="', "[/color]",
                "[size=\"", "[/size]",
                '[url="', "[/url]",
                "[mail=\"", "[/mail]",
                "[code]", "[/code]",
                "[quote]", "[/quote]",
				"[p]", "[/p]",
                '[br]',
				'"]');
				
  $htmlcode = array("&lt;", "&gt;",
                "<ul class=\"list\">", "</li><li>", "</li></ul>", 
                "<img src=\"", "\">", 
                "<b>", "</b>", 
                "<u>", "</u>", 
                "<i>", "</i>",
                "<span style=\"color:", "</span>",
                "<span style=\"font-size:", "</span>",
                '<a href="', "</a>",
                "<a href=\"mailto:", "</a>",
                "<code>", "</code>",
                "<br/><div class=\"quote\" \"><p>", "</p><div style=\"float: right;\"><img src=\"/images/closequote.png\" alt=\"Quote\" height=\"40\" width=\"40\"></div><div style=\"clear: both;\"></div></div>",
				"<p>", "</p>",
				"<br/>",
                '">');
  $newtext = str_replace($bbcode, $htmlcode, $text);
  
$newtext = str_replace("<br/><ul class=\"list\">","<ul class=\"list\">",$newtext);
   
$newtext = str_replace("<br/></li>","</li>",$newtext);//third pass
   
$newtext = str_replace("<ul class=\"list\"></li>","<ul class=\"list\">",$newtext);
   
   $newtext = str_replace("£","&pound;",$newtext);
   
  return $newtext;
}
 
Loading Advertisement...
 
[+][-]09.04.2008 at 09:33AM PDT, ID: 22389551

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP and Databases, Hypertext Markup Language (HTML), MySQL Server
Tags: html php
Sign Up Now!
Solution Provided By: b0lsc0tt
Participating Experts: 2
Solution Grade: A
 
 
[+][-]09.04.2008 at 09:46AM PDT, ID: 22389707

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09.11.2008 at 01:10PM PDT, ID: 22454163

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628