3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function GetBetween($content,$start,$end){ $r = explode($start, $content); if (isset($r[1])){ $r = explode($end, $r[1]); return $r[0]; } return ''; } echo GetBetween('foo test bar', 'foo', 'bar'); echo explode('bar','foo test bar'); //print_r(explode("help","help php help program help is good")); ?>
Output for 5.5.0 - 7.1.0
test Notice: Array to string conversion in /in/bfLOb on line 12 Array
Output for 4.3.0 - 5.4.45
test Array