时间:2021-07-01 10:21:17 帮助过:21人阅读
代码如下:
function get_between($input, $start, $end) {
$substr = substr($input, strlen($start)+strpos($input, $start),
(strlen($input) - strpos($input, $end))*(-1));
return $substr;
}
$string = "www.bitsCN.com";
$start = "www.";
$end = ".net";
echo get_between($string, $start, $end); // output:coderbolg
代码如下:
$string = "http://www.bitsCN.com/";
$start = "http://";
$end = "/";