我正在尝试在引号之外查找参数(单或双)
$sql = "
INSERT INTO Notifify (to_email, msg, date_log, from_email, ip_from)
VALUES
(
:to_email,
'test teste nonono',
'2013-02-01 10:48:27',
'bar@foo',
:ip_from
)
";
$matches = array();
preg_match_all('/:[A-Za-z0-9_]*/', $sql, $matches);
上面的代码将产生以下结果,
print_r($matches); // array(:to_email, :48, :27, :ip_from)
我只想:
:to_email
:ip_from