array_filter doesn't seems to work for words having apostrophe and dash

后端 未结 3 1768
时光取名叫无心
时光取名叫无心 2020-12-12 07:36

I have a php code as shown below:

$variable = \\CTIME\\DataPoint\\get_message();  // Line A
echo \'
\'; print_r($variable); echo \         


        
3条回答
  •  一整个雨季
    2020-12-12 08:01

    Your code seems good.
    My guess is that this is a charset issue: the "right single quotation mark" (’) is a unicode char and is not part of ASCII charset.

    If the string from the source data and the string in your PHP script use a distinct charset, they might be different (not the same sequence of bytes).

    For instance, if you're using UTF-8: check that the data you're fetching with get_live_today_streams() is UTF-8 encoded, and make sure that your .php file is UTF-8 encoded as well.

    (Have a look at this post to see how to convert a ANSI file to UTF-8 using notepad++)

提交回复
热议问题