---
title: "[BASE] file_get_contents通过代理获取网络地址内容"
author: "marx"
date: "2013-04-26T22:12:05Z"
tags: []
categories: ["Web前端"]
slug: "base-file-get-contents"
draft: false
lastmod: "2013-04-26T22:12:05Z"
id: 1855562
url: "https://marx.iteye.com/blog/1855562"
---

$opt = array(

     'http'=&gt;array(

           'method'=&gt;'GET',

           'header'=&gt;"Content-Type:text/html;charset=utf-8"

           'proxy'=&gt;"http://192.168.1.1:8080",

           'timeout'=&gt;30

 

      )

);

 

$context = stream\_context\_create($opt);

 

$result = file\_get\_contents("http://www.iteye.com",false,$context);