PHP在<script type =“text / javascript”> </ script>中获取内容

Im trying to get the content what is is the javascript script tag.

<script type="text/javascript"> [CONTENT HERE] </script>

currently i have something like this:

$start = preg_quote('<script type="text/javascript">', '/');
$end = preg_quote('</script>', '/');

preg_match('/ '.$start. '(.*?)' .$end.' /', $test, $matches);

But when i vardump it, its empty

查看全部
douzhong1907
douzhong1907
2017/10/30 13:20
  • php
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

3个回复