php to extract a string from double quote

前端 未结 6 1994
灰色年华
灰色年华 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:32

    As long as the format stays the same you can do this using a regular expression. "([^"]+)" will match the pattern

    • Double-quote
    • At least one non-double-quote
    • Double-quote

    The brackets around the [^"]+ means that that portion will be returned as a separate group.

提交回复
热议问题