0

我想从这个字符串中得到“bla bla bla”

jQuery('#showcasecities').html("bla bla bla");

我试过了

preg_match_all("/jQuery(\'#showcasecities\').html(\"([^`]*?)\");/", $string, $matches);

没有运气=(请帮忙!

4

2 回答 2

1

您需要转义括号。相反,试试这个

preg_match_all("/jQuery\(\'#showcasecities\'\).html\((\"(.*?)\")\);/", $string, $matches);
于 2013-01-21T17:47:12.613 回答
1

试试这个:

preg_match_all("#jQuery\('\#showcasecities'\)\.html\((.*)\)#",$string,$matches);
于 2013-01-21T17:47:22.483 回答