略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: 示例

2025-02-26

示例

目录

添加备注

用户贡献的备注 1 note

up
119
cmnajs at gmail dot com
16 years ago
Following code returns the curl output as a string.

<?php
// create curl resource
$ch = curl_init();

// set url
curl_setopt($ch, CURLOPT_URL, "example.com");

//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// $output contains the output string
$output = curl_exec($ch);

// close curl resource to free up system resources
curl_close($ch);
?>

官方地址:https://www.php.net/manual/en/curl.examples.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3