I have a string like this
"data:image/jpeg;base64,/9j/4AAQS...","data:image/jpeg;base64,/9j/4AAQS","data:image/jpeg;base64,/9j/4AAQS"
","
$str = explode(" \",\" ",$str);
Instead of explode(" \",\" ",$str);
write explode("\",\"",$str);
You had two spaces in your regex that aren't there in your string. Therefore it won't match.