PHP - return string between start and end strings
<?php
function GetBetween($content,$start,$end){
$r = explode($start, $content);
if (isset($r[1])){
$r = explode($end, $r[1]);
return $r[0];
}
return '';
}
/*
source:
http://www.jonasjohn.de/snippets/php/get-between.htm
example:
$x = 'qwertyuiop';
$start = 'ert';
$end = 'op';
echo getBetween($x, $start, $end);
result:
yui
*/
?>