开发者

Remove certain symbol from insert

I would like to remove the symbol ° from a field that's to be inserted into my database. Now I already have Format::Strip_tags on my field.

开发者_运维问答

How can I get the value ° from the field to be changed with #? The symbol ° gives error and when I check my MYSQL database, I get this:

Connection: utf8_general_ci

Database: latin1_swedish_ci

Server: latin1_swedish_ci


In PHP:

str_replace('°', '#', $yourString)


You could use the REPLACE funciton:

INSERT INTO YourTable
    SELECT REPLACE(YourValue, '°', '#')
    ...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜