function get_string_between($string, $start, $end){

$string = " ". $string;

$ini = strpos($string,$start);

if ($ini == 0) return "";

$ini += strlen($start);

$len = strpos($string, $end, $ini) - $ini;

return substr($string, $ini, $len);

}

//USAGE

echo get_string_between("this is a test", "this ", " a test"); //RETURNS 'is'


This is to implement a very useful and easy to use utility for PHP.
Call the function as Sample on the value chain of knowledge between the points of the chain.
There are three variables, you need to function, the target text, the data point Finally, the data for the left and the right to be in that order. The return of the Function call to the string value that is between the two data points.
It is important that that the space is a valid character in the account or you lose sleep to understand what works not only recognize that it is not a space somewhere!

The mechanism is very simple. First, find the position of the point of all left, then add the total length. Next you will find the position of the entire correct data point integer equal to the length of the left corner and then subtract the left from the total length of the page.

Finally there is the original string to the end of the chain length of the left Starting point and end point of the line right.