2018-04-19

array(

'method' => "GET",

'timeout' => 10,));

$context = stream_context_create($opts);

$xml_data = file_get_contents($info_url, false, $context);

//$xml_data = file_get_contents($info_url);

// $xml_data = preg_replace '=(.*);' $xml_data

//str_replace("world","",$xml_data);

    //str_replace("world","",$xml_data);

//$xml_data = preg_replace("/=|;/i","",$xml_data);

$json_data = preg_replace("/\t|QZOutputJson=/","",$xml_data);

$json_data = preg_replace("/\t|;/","",$json_data);

$json_data_arry = json_decode($json_data, true);

//$json_arry['vl']['vi'];

//$fvkey = $json_arry['vl']['vi']['fvkey'];

//$fvkey = $json_arry['vl']['vi']['fn'];

$self_host = $json_arry['vl']['vi']['ul']['ui'][0]['url'];

//$self_host = $json_arry['self_host'];

//$xml_data = json_encode($xml_data);

  //$xml_parser=xml_parser_create();

  //xml_parse_into_struct($xml_parser,$xml_data,$xml_array);

  //xml_parser_free($xml_parser);

//return $xml_array[20]['value'];

return "self_host:" . $self_host . ", -----------info_url:" . $info_url . ", ----------json_data:" . $json_data . ", ----------xml_data:" . $xml_data . ", ----------json_data_arry :" . $json_data_arry ;

//return $url_vid;

}

if(is_array($_GET)&&count($_GET)>0){

  if(isset($_REQUEST["url"])){

    $url=$_REQUEST["url"];//存在

    $vid=GetVid($url);

    echo GetUrl($vid);

  }else{

    die("Error!");

  }

}else{

  die("Error!");

}

?>

你可能感兴趣的:(2018-04-19)