I need to extract a string with any symbols between a doublequotes using preg_match including double quotes as well.
I've tried all solutions in the question below but nothing has worked for my case: php to extract a string from double quote
Sample string: "ASD ""ASD ADS"""
I need to extract: ASD ""ASD ADS""
Current code which is working except I don't know how to handle the exception above which ruining whole structure:
$regex = '/"(.*)"/imU';
$content = file_get_contents($file->getRealPath());
$filename = $file->getClientOriginalName();
preg_match_all($regex, $content, $matches);
return $matches[0];