php to extract a string from double quote

前端 未结 6 1980
灰色年华
灰色年华 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条回答
  •  萌比男神i
    2020-12-05 03:17

    Just use str_replace and escape the quote:

    str_replace("\"","",$yourString);
    

    Edit:

    Sorry, didnt see that there was text after the 2nd quote. In that case, I'd simply to 2 searches, one for the first quote and one for the 2nd quote, and then do a substr to extra all stuff between the two.

提交回复
热议问题