How can I match all characters between 2 specified characters, say \" \" -> from sdfsf \" 12asdf \" sdf
\" \"
sdfsf \" 12asdf \" sdf
I want to get 12asdf o
12asdf
You can use preg_match(/"([^"]*)"/,$input,$matches);. $matches[1] will have what you want.
preg_match(/"([^"]*)"/,$input,$matches);
$matches[1]