3v4l.org

run code in 300+ PHP versions simultaneously
<?php function Get($start, $end, $str) { $matches = array(); $regex = "/$start(.*)$end/"; preg_match_all($regex, $str, $matches); if(count($matches[1] == 1)) return $matches[1][0]; else return $matches[1]; } $str = '@XSDSDS@'; print_r(Get('@', '@', $str)); ?>

preferences:
62.09 ms | 402 KiB | 5 Q