I have a PHP string of the following format:
$str = 'This is a "sample string"';
I want to remove the double quoted string. Like this:
This is a
What I tried:
$fileread = preg_replace('!/\*.*?\*/!s',' -', $fileread);
$fileread = preg_replace('![ \t]*//.*[ \t]*[
]!', '', $fileread);
$separator = preg_replace('/"[^"]+"/','',$fileread);
$separator = explode(" ",$separator);
Is there an easier way to extract that?