I have this data:
{"names":["George","Eric","Alice"]}
And I want to use preg_match_all
to filter out the words in between quotation like this:
$s = $data;
if (preg_match_all('/"([^:]*)"/', $s, $matches)) {
echo join("
", $matches[1]);
}
But this is outputting names George","Eric","Alice
I tried many things but I cant figure it out.