removing strange characters from php string

前端 未结 14 928
忘了有多久
忘了有多久 2021-01-31 17:45

this is what i have right now

Drawing an RSS feed into the php, the raw xml from the rss feed reads:

Paul’s Confidence

The ph

14条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-31 18:32

    Yeah this is not working for me. What is the workaround for this? – vaichidrewar Mar 12 at 22:29

    Add this to the HTML head (or modify if already there):

    
    

    This will encode the funny chars like "“" into UTF-8 so that the str_replace() function will interpret them properly.

    Or you can do this:

    ini_set('default_charset', 'utf-8');
    

提交回复
热议问题