Jump to content

[SOLVED] char  problem


tomasd

Recommended Posts

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

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"?

"Â " 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!!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.