php 怎么取两个符号中间字符?

用一个PHP怎么获取下面两个不同网页中获取“https://s.click.taobao.com/8OmDwuv”或“https://m.tb.cn/h.ev2yaos”??
有个网页中有句
ifr.src = "tbopen://m.taobao.com/tbopen/index.html?action=ali.open.nav&module=h5&bootImage=0&h5Url="+encodeURIComponent("https://s.click.taobao.com/8OmDwuv");
另一个网页中有句
ifr.src = "tbopen://m.taobao.com/tbopen/index.html?action=ali.open.nav&module=h5&bootImage=0&h5Url="+encodeURIComponent("https://m.tb.cn/h.ev2yaos");

第1个回答  2019-11-24
要截取指定字符串,其前后字符必须就要具有唯一性。
例:abc555xyz 和 abc666xyz
那么要截取555和666,他们相同的且唯一的前后标记则为:abc xyz
方法一:getNeedBetween函数截取
$zhi=getNeedBetween($str, 'abc','xyz');
方法二:正则截取
方法三:explode函数
字符分隔函数,如题例
$a=explode($str,"encodeURIComponent")
$a[1] 值可以得出encodeURIComponent之后的字符串 即("https://m.tb.cn/h.ev2yaos");
再使用substr函数切割。
方法四:substr函数
$start="abc";
$end="xyz";
$zhi=substr($input, strlen($start)+strpos($input, $start),(strlen($input) - strpos($input, $end))*(-1));
方法还可以举例很多种,大同小异。