tomasd Posted September 12, 2008 Share Posted September 12, 2008 hi, I have a something strage going on here... I'm doing web page dump with curl and then I remove html tags with $curl_data = strip_tags($curl_data); If I then have echo $curl_data and run script on my console I'm getting an output with  characters, but if I run the script and send the output to file i.e. $php test.php > output there are no  characters. Can somebody please tell me how to get rid of  in $curl_data? is there a function like strip_non_asci_tags? Link to comment https://forums.phpfreaks.com/topic/123933-solved-char-%C3%A2-problem/ Share on other sites More sharing options...
effigy Posted September 12, 2008 Share Posted September 12, 2008 It appears that you're working with UTF-8. Link to comment https://forums.phpfreaks.com/topic/123933-solved-char-%C3%A2-problem/#findComment-639781 Share on other sites More sharing options...
tomasd Posted September 12, 2008 Author Share Posted September 12, 2008 It appears that you're working with UTF-8. Hey thanks for replying, the problem I'm having here is more with regex not recognising the char and not matching the string... I guess fixing my regex would work just fine... how do I change $regex_arrive = "(\d{2}:\d{2}) Arrive"; to ignore  from "14:20 Arrive"? Link to comment https://forums.phpfreaks.com/topic/123933-solved-char-%C3%A2-problem/#findComment-639787 Share on other sites More sharing options...
effigy Posted September 12, 2008 Share Posted September 12, 2008 "Â " is the UTF-8 encoding for a "NO-BREAK SPACE." Perhaps you should decode the data first? See utf8_decode. You can also try using \p{Z} in place of the space in your regex. Link to comment https://forums.phpfreaks.com/topic/123933-solved-char-%C3%A2-problem/#findComment-639802 Share on other sites More sharing options...
tomasd Posted September 12, 2008 Author Share Posted September 12, 2008 "Â " is the UTF-8 encoding for a "NO-BREAK SPACE." Perhaps you should decode the data first? See utf8_decode. You can also try using \p{Z} in place of the space in your regex. thanks sorted; // curl data $curl_data = $curl_get; $curl_data = utf8_decode ($curl_data); $curl_data = strip_tags($curl_data); then as for regex; $regex_depart = "(\d{2}:\d{2}).Depart"; $regex_arrive = "(\d{2}:\d{2}).Arrive"; Thanks for your help!!! Link to comment https://forums.phpfreaks.com/topic/123933-solved-char-%C3%A2-problem/#findComment-639819 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.