php to extract a string from double quote

前端 未结 6 1997
灰色年华
灰色年华 2020-12-05 03:08

I have a string:

This is a text, \"Your Balance left $0.10\", End 0

How can I extract the string in between the double quotes an

6条回答
  •  鱼传尺愫
    2020-12-05 03:36

    Unlike other answers, this supports escapes, e.g. "string with \" quote in it".

    $content = stripslashes(preg_match('/"((?:[^"]|\\\\.)*)"/'));
    

提交回复
热议问题