3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function stripphptags($code){ $phpOpenTags = array( '<?','<?php', '<?PHP', '<?Php', '<?PHp', '<?PhP', '<?pHP', ); $phpCloseTag = '?>'; $scriptOpenTags = array('<script>', //rest later ); $scriptCloseTags = array('</script>', '<script/>' ); $code = str_replace($phpOpenTags, '&lt;php', $code); $code = str_replace($phpCloseTag, 'php&gt;', $code); $code = str_replace($scriptOpenTags, '&lt;script&gt;', $code); $code = str_replace($phpOpenTags, '&lt;/script&gt;', $code); return $code; } echo stripphptags('<?php ldkfjal;skdfjasdlkjf ?>');
Output for 4.3.0 - 7.1.0
&lt;phpphp ldkfjal;skdfjasdlkjf php&gt;