All pastes #896999 Raw Edit

Untitled

public text v1 · immutable
·published 2008-02-09 03:10 UTC
rendered paste body
function GetBetween($find1, $find2, $string) {
	$parse = explode($find1, $string, 2);
	$parse = substr($parse[1], 0, stripos($parse[1], $find2));
	return $parse;
}

function GetBetweenAll($find1, $find2, $string, $limit){
	$elements = array();
	while($word = GetBetween($find1, $find2, $string)){
		array_push($elements, $word);
		$string = str_replace($find1.$word.$find2, null, $string);
	}
	return $elements;	
}