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.
<?php
$str = 'This is a text, "Your Balance left $0.10", End 0';
//forward slashes are the start and end delimeters
//third parameter is the array we want to fill with matches
if (preg_match('/"([^"]+)"/', $str, $m)) {
print $m[1];
} else {
//preg_match returns the number of matches found,
//so if here didn't match pattern
}
//output: Your Balance left $0.10
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…