<?php
function GetBetween($var1="",$var2="",$pool){
$temp1 = strpos($pool,$var1)+strlen($var1);
$result = substr($pool,$temp1,strlen($pool));
$dd=strpos($result,$var2);
if($dd == 0){
$dd = strlen($result);
}
return substr($result,0,$dd);
}
//===============================================
$str ='chce wszystko od @to chce wyciagnąć@';
echo GetBetween('@','@',$str);//to chce wyciagnąć
?>