說明:初始化一個新的 CURL 會話,回傳控制代碼供後續函數使用。
int curl_init([string url])
若提供選擇性 url 參數,將自動設定 CURLOPT_URL 選項。
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.zend.com/');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
?>