Using regex in a string for strpos()

前端 未结 2 2126
眼角桃花
眼角桃花 2021-02-19 00:18

I want to get the scripts to search the $open_email_msg which different e-mails will have different info but the same format as below.

I haven\'t really used regex much

2条回答
  •  时光取名叫无心
    2021-02-19 00:45

    You can use preg_match instead of strpos for regex

    preg_match (regex, $string, $matches, PREG_OFFSET_CAPTURE);
    
    PREG_OFFSET_CAPTURE gives you the position of match.
    

提交回复
热议问题