English 中文(简体)
我怎么能够把这些特性(a?2s)与PHP分开?
原标题:How can I strip these (â?²s) type of characters with PHP?

I am developing an application using CodeIgniter/MySQL. Last night I stored a title into my database "HTML5′s placeholder Attribute". After storing when I retrieve from database for display it shows some strange characters like this: "HTML5â?²s placeholder Attribute".

我如何能够避免这些奇怪的特性?

问题回答

You probably just need to make sure both the database table you are storing data is set to store in UTF-8 as well as the html page that displays the data should also be explicitly set to UTF-8 encoding.

阁下的“URL”应用(见kphp.com/look/phpquery-jquery-port-to-php/1758)表明(通过火焰燃烧)

Response Headers
Date    Sat, 14 Jan 2012 06:26:31 GMT
Server  Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
X-Powered-By    PHP/5.2.17
Keep-Alive  timeout=5, max=100
Connection  Keep-Alive
Transfer-Encoding   chunked
Content-Type    text/html

但如果UTF-8的编码产出正确,则显示最后一行是行的。

Content-Type    text/html; charset=UTF-8

可通过在“欧洲开发机构”文件中输出一个元件,对你的超文本进行编码:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

或者你能够用购买力平价来确定这一点:

header ( Content-type: text/html; charset=utf-8 );

我在复制文本编辑的数据并在phpmyadmin中保存数据时也存在同样的问题。 如果你重新这样做,那么你的文本编辑可能会使用不同的编码。 我建议你将数据复制成一个简单的文本编辑,如一个笔记本,并人工取代热带。 《手册》将“......”改为“......并且应当做罚款”。

i have an issue related with the utf-8 charset. I ve been all around the web (well, not entirely) but for quite awhile now and the best advice was and is to set the header charset to "UTF-8".

However, I was developing my web application locally on my machine using xampp (and sometimes wamp so as to get a distinction of the two when it came to debugging my code). Everything was working great =). But as soon as i uploaded it online, the result was not all that jazzy (the kind of errors you would get if you had set the headers to a different charset like "iso-8859-1"). Every header in my code has UTF-8 as the default charset, but i still got the same "hieroglyphic thingies". Then you guys gave me the idea that the issue isn t my code but the php.ini that was running it.. Turns out my local machine was running php 5.5 and the cpanel where i had uploaded my web application was running native php 5.3. Well, when i changed the version of php that my cpanel was set by default to PHP 5.5, believe you me guys =) it worked like a charm just like as if i was right there at the localhost of machine.

www.un.org/Depts/DGACM/index_spanish.htm 如果你遇到与我同样的问题,那么我就确保你的购买力平价为5.5本。 我把这 co子放在一边,我觉得你有gu。 Cheers!





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签