I am creating an online sandbox editor for php, and all is good so far, until I used more than I structure of php code.
$string = explode("<?php", $page); if(count($string) > 1) { echo $string[0]; $string = explode("?>", $string[1]); eval($string[0]); if(count($string) > 1) { echo $string[1]; } } else { echo $page; }
This only cycles through 1 set of <?php and ?>, how would I go about having x number of <?php and ?> ?
Use a foreach loop?
Thanks,