duanca3415 2014-11-17 21:44
浏览 35

Php Regex介于文本之间不起作用

I´m getting data with

$newtext = fread($rcon, 102400);

But this script is not working

$offset = stripos($newtext, 'ÿ');

But if i print it i could see the y

EYî ÿ5aa68

Why is it not working? Its kind of wired.. Because .. It is there..^^

Thanks for your help and time :)

  • 写回答

1条回答 默认 最新

  • douyue2313 2014-11-17 21:51
    关注
    $answer .= preg_replace ('/(BE.*?)ÿ/' , '' , $newtext);
    

    or if you only want to remove between codes:

    $answer .= preg_replace ('/BE(.*?)ÿ/' , '' , $newtext);
    

    You can play tested here (expand SUBSTITUTION TAB): http://regex101.com/r/tO1aB8/1

    评论

报告相同问题?