php to extract a string from double quote
问题 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 and have only the text (without the double quotes): Your Balance left $0.10 I have tried preg_match_all() but with no luck. 回答1: 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