Method 1:
Use file_get_contents to get the content in get mode
[php] view plaincopyprint? <?php $url='http://www.domain.com/'; $html = file_get_contents($url); echo $html; ?>
Method 2:
Use fopen to open the url and get the content by get method
[php] view plaincopyprint? <?php $fp = fopen($url, 'r'); //返回请求流信息(数组:请求状态,阻塞,返回值是否为空,返回值http头等) [php] view plaincopyprint? stream_get_meta_data($fp); [php] view plaincopyprint? while(!feof($fp)) {
Recommended tutorial:
PHP development APP interface video tutorial
The above is the detailed content of How to loop request interface in php. For more information, please follow other related articles on the PHP Chinese website!