Hi PyroInACage,
I don't know really what you need! but, I wait to have helped! =]
First, PHP is sensitive case! ohhhhhhh!
len -> strlen();
'First' is difference of $First.
$First = substr($lookin, strstr($lookin, $a));
$First = substr($lookin, strstr($lookin, $b)); //error of writing
$a0 = strstr($LookIn, $First) + len($a);
//this is wrong! $a0 -> need a type integer, OK!
substr($lookin,$a0, $a1);
<?
function Between($LookIn, $a, $b)
{
if((!empty($a)) && (!empty($b)) && (!empty($LookIn))){
$First = strpos($LookIn, $a);
$Last = strpos($LookIn, $b);
if (($First < 0) || ($Last < 0) || ($First > $Last))
{
$ret_val = 'empty';
}
else
{
$a0 = $First + strlen($a);
$a1 = $Last - ($First + strlen($a));
$ret_val = substr($LookIn, $a0, $a1);
}
}else{
$ret_val = "The String A, B or LookIn is empty";
}
return $ret_val;
}
$funct = between("Hello Word!!!", "e", "W");
echo $funct;
?>
Kind Regards,
Marcio Lins
Solution Developer
Enter your message below
Sign in or Join us (it's free).