我有一个文字标题
This User "The Title Of The Post"
Run Code Online (Sandbox Code Playgroud)
我想抓住INSIDE中的引号,并将其存储在变量中.我怎么用正则表达式和PHP做到这一点?
<?php
$x = 'This User "The Title Of The Post"';
preg_match('/".*?"/', $x, $matches);
print_r($matches);
/*
Output:
Array
(
[0] => "The Title Of The Post"
)
*/
?>
Run Code Online (Sandbox Code Playgroud)