Ejemplo n.º 1
0
Archivo: jiequ.php Proyecto: QPG/djzs
function fetch_match_contents($begin, $end, $c)
{
    $begin = change_match_string($begin);
    $end = change_match_string($end);
    if (@preg_match("/{$begin}(.*?){$end}/i", $c, $rs)) {
        return $rs[1];
    } else {
        return "";
    }
}
Ejemplo n.º 2
0
function fetch_match_contents($begin, $end, $c)
{
    $begin = empty($begin) ? '' : change_match_string($begin);
    $end = empty($end) ? '' : change_match_string($end);
    $p = "#{$begin}(.*){$end}#iU";
    //i表示忽略大小写,U禁止贪婪匹配
    if (preg_match_all($p, $c, $rs)) {
        return $rs;
    } else {
        return "";
    }
}