I am basically processing tweets for a project of mine. I am trying to separate the emoticons, if any and storing them in a separate array (removing them from the tweet which shall be processed further). No matter what I try, I just can’t seem to detect <3 in the string. Neither str_replace() nor preg_replace() seem to work.
I believe there is something wrong because of the ‘<‘ symbol, a substr_count($str, ‘<‘) always returns a 0.
Thanks
The Twitter API always sends
<as<and>as>for security purposes. (The motivation is to make it safe for you to display tweets on a webpage without worrying about sanitizing them yourself to avoid XSS attacks).