Created
November 15, 2016 21:29
-
-
Save usingthesystem/879491d2690974c97ebc810fecdf5977 to your computer and use it in GitHub Desktop.
Get all script tags from a string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$js = ""; | |
$content = file_get_contents("http://website.com"); | |
preg_match_all('#<script(.*?)</script>#is', $content, $matches); | |
foreach ($matches[0] as $value) { | |
$js .= $value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment