function GetBetweenAll($find1, $find2, $string, $limit = 0){ if(!$limit){ $elements = array(); while($word = GetBetween($find1, $find2, $string)){ array_push($elements, $word); $string = str_replace($find1.$word.$find2, null, $string); } return $elements; }elseif($limit){ $elements = array(); $x = 0; while($word = GetBetween($find1, $find2, $string) && $x < $amount){ array_push($elements, $word); $string = str_replace($find1.$word.$find2, null, $string); $x++; } return $elements; } }