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? Quote Link to comment 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. Quote Link to comment 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"? Quote Link to comment 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. Quote Link to comment 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!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.