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; }
function pick($content, $ft, $th) { $c = $content; 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; }