Exemplo n.º 1
0
function pick($url, $ft)
{
    $c = fetch_urlpage_contents($url);
    foreach ($ft as $key => $value) {
        $rs[$key] = fetch_match_contents($value["begin"], $value["end"], $c);
    }
    return $rs;
}
Exemplo n.º 2
0
function pick($url, $ft, $th)
{
    $c = fetch_urlpage_contents($url);
    foreach ($ft as $key => $value) {
        $rs[$key] = fetch_match_contents($value["begin"], $value["end"], $c);
        if (is_array($th[$key])) {
            foreach ($th[$key] as $old => $new) {
                $rs[$key] = str_replace($old, $new, $rs[$key]);
            }
        }
    }
    return $rs;
}