📜  两个字符串之间的字符串 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:26.346000             🧑  作者: Mango

代码示例1
// Gegasoft found this useful and use in helper class

function get_string_between($string, $start, $end){
    $string = ' ' . $string;
    $ini = strpos($string, $start);
    if ($ini == 0) return '';
    $ini += strlen($start);
    $len = strpos($string, $end, $ini) - $ini;
    return substr($string, $ini, $len);
}