<?php
class curl
{

	function curl(){}

	function cut($str, $start, $end, $middle = 0)
	{
		$temp = explode($start, $str);
		if(!$end) return $temp[$middle];
		if(!isset($temp[1])) return '';
		$string = explode($end, $temp[1]);
		return $string[$middle];
	}

	function clear_html($string)
	{
		return preg_replace("/\<(.*?)\>/si", '' , $string);
	}

	function clear_br($string) 
	{
		$arr = array("<br>", "<br />", "<br/>");
		return str_replace($arr, "\n", $string);
	}

	function relace_script($str)
	{
		static $sc = array('\'', '"', "\n", "\t"," ","　");
		return str_replace($sc, '', $str);
	}

	function replace($string)
	{
		$arr = array('/',' ', '　', "\r", "\n","\t");
		if(!is_array($string)){
			return trim(str_replace($arr, '', $string));
		}else{
			$temp = array();
			foreach($string as $val){
				$temp[] = $this->replace($val);
			}
			return $temp;
		}
	}

	function load($url) 
	{
		return qbase::load($url);
	}

	function charset_to_gb2312($str)
	{
		return qbase::iconvs($str, 'gbk', 'utf-8');
	}

	function charset_to_utf8($str)
	{
		return qbase::iconvs($str, 'utf-8', 'gbk');
	}

	function replace_name($name)
	{
		$arr = array("大片","片","剧","大陆","日韩","美国","爱情","动作","恐怖","影院","《","》","【","】","古装","武侠","_","-","国语","中字","字母","高清");
		$name= str_replace($name, "", $name);
		$name = preg_replace("/200[0-9]/", "", $name);
		return $name;
	}
}
?>