DEFINITION

function between($this, $that, $inthat, $check_plain = TRUE)

This function returns the whole string that comes between the $this and $that string in the $inthat variable. If there is no string $this or $that in the $inthat variable then the return value is null.

$this = The beginning tag you are searching for

$that = The ending tag you are searching for

$inthat = The text you are trying to search in

$check_plain = Use the check_plain() function. False = disable check_plain()

RETURN VALUES
Returns a string value

EXAMPLES
With Check_plain enabled since the stuff we are searching is only text. This stops any unwanted HTML/JS/XML/etc from causing any security problems

$inthis = "Tag: this is tag 1
Tag: This is tag 2
Tag: 
Tag: This is tag 4
";

$start_tag = "Tag: ";
$end_tag = "\n";

$value = between($start_tag, $end_tag, $inthis);
//$value is now set to 'This is tag 1'

With Check_plain DISABLED since the stuff we are searching is tagged (html, xml, whatever). This disables the security of our function so the value returned should be scrutinized extensively to make sure it doesnt open any cross-site scripting holes.

$inthis = '<tag>This is tag 1</tag><tag>This is tag 2</tag><tag></tag><tag>This is tag 4</tag>';

$start_tag = "<tag>";
$end_tag = "</tag>";

$value = between($start_tag, $end_tag, $inthis, FALSE);
//$value is now set to 'This is tag 1'