3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data['content'] = "<script>test</script>"; $data['contentJS'] = ''; preg_match_all("'<script(.*?)>(.*?)</script>'si", $data['content'], $matches); if (isset($matches[0]) && !empty($matches[0])) { foreach ($matches[0] as $match) { $data['contentJS'] .= $match; $data['content'] = str_replace($match, '', $data['content']); } }
Output for 5.6.0 - 7.3.0alpha1