downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

cURL İşlevleri> <Örnekler
[edit] Last updated: Fri, 23 Mar 2012

view this page in

Örnekler

PHP'yi cURL desteğiyle derlediyseniz cURL işlevlerini kullanmaya başlayabilirsiniz. cURL işlevlerinin kullanım amacı ve sırası, ana hatlarıyla, curl_init() işlevini kullanarak bir cURL oturumu başlatıp, aktarımın tüm seçeneklerini curl_setopt() ile belirledikten sonra oturumu curl_exec() ile çalıştırıp işiniz bitince curl_close() ile oturumu sonlandırmak şeklindedir. Burada, example.com ana sayfasını bir dosyaya aktarmak amacıyla cURL işlevlerinin kullanımı örneklenmiştir:

Örnek 1 - example.com ana sayfasını bir dosyaya aktarmak amacıyla cURL işlevlerinin kullanımı

<?php

$ch 
curl_init("http://www.example.com/");
$fp fopen("example_homepage.txt""w");

curl_setopt($chCURLOPT_FILE$fp);
curl_setopt($chCURLOPT_HEADER0);

curl_exec($ch);
curl_close($ch);
fclose($fp);
?>



add a note add a note User Contributed Notes Örnekler
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites