Jump to content

how to detect texts before and after?


jjk2

Recommended Posts

<script type="text/javascript">

var so = new SWFObject('player.swf','mpl','535','422','9');

so.addParam('allowscriptaccess','always');

so.addParam('allowfullscreen','true');

so.addParam('flashvars','file.xml');

so.write('player');

</script>

 

 

so how can i search for addParam, but automatically end up with the entire <script> </script> ?

 

so i search for addParam, and then automatically it looks up until it gets to <script>. and looks down, until it gets to </script>

 

 

Link to comment
https://forums.phpfreaks.com/topic/151853-how-to-detect-texts-before-and-after/
Share on other sites

I would do it a different way.  Search for all the script tags and then search within the script tags for addParam.

 

preg_match_all("/<script(.*)<\/script>/Uis", $somedata, $scriptarray);

foreach ($scriptarray[0] as $script) {

    if (strpos($script) === true) {

          echo "This script tag has addParam";

    }

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.