This is a discussion on "php replacing £ with £ error :s" within the PHP Forum section. This forum, and the thread "php replacing £ with £ error :s are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
php replacing £ with £ error :s
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
php replacing £ with £ error :s
Got a bit of a strange error. I'm
using the php htmlentities command to replace parts of a string, used it tons of times before with no problems. Now I'm using the same char encoding and everything as usual, but it's replacing pound signs with £ instead of just £ Never had this before or heard of it, and had a look around on google but can't find anything. Any ideas on what's going on please? Here's my form code <form method="post" action="addcarpetvalid.php" enctype="multipart/form-data"> - uploading an image later on in the form <p>Title:<br /> <input name="title" /></p> and here's my replace line $title=$_POST['title']; $title = htmlentities($title, ENT_QUOTES); |
|
|
|
|||
|
Re: php replacing £ with £ error :s
I've removed all encoding and still get the problem, could it be anything to do with the server setup?
|
|
|||
|
Re: php replacing £ with £ error :s
To me it also sounds like an encoding issue. The fact that the single £ is translated into two entities suggests that your input string might be UTF-8 encoded. Have you tried specifying UTF-8 as third parameter in htmlentities?
|
|
|||
|
Re: php replacing £ with £ error :s
Nope, how do I do that please?
|
|
|||
|
Re: php replacing £ with £ error :s
By adding the string 'UTF-8' as third parameter
|
![]() |
| Tags |
| htmlentities, php, replace |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Replacing < with < and > with > | Jack Franklin | PHP Forum | 1 | Mar 29th, 2008 10:04 |
| replacing images in adobe cs3 pro | meeuw | Flash & Multimedia Forum | 6 | Feb 29th, 2008 16:27 |
| [SOLVED] making sure characters saved to db remain in the long version, like '&pound; | cosmicbdog | PHP Forum | 3 | Dec 1st, 2007 03:54 |
| Keep getting error message Microsoft VBScript runtime error '800a01a8' | cpando1974 | Classic ASP | 2 | Aug 7th, 2007 12:00 |
| replacing tables | c00rdb | Web Page Design | 0 | Feb 20th, 2007 20:30 |