I have this string "PAX 098-5503268037/ETAI/USD107.75/15MAY20/KTMVS31KL/10303171" and would like to extract the USD107.75.I have this function:
Here:
$str = PAX 098-5503268037/ETAI/USD107.75/15MAY20/KTMVS31KL/10303171;
$from = '/ETAI';
$to = '/';
public function getStringBetween($str,$from,$to)
{
$sub = substr($str, strpos($str,$from)+strlen($from),strlen($str));
return substr($sub,0,strpos($sub,$to));
}
The function only return an empty string.
What am I missing?
Thanks
/and take 3rd element?