1
0
mirror of https://github.com/php/doc-tr.git synced 2026-03-23 23:02:09 +01:00
Files
archived-doc-tr/reference/curl/examples.xml
2021-03-13 15:31:29 +03:00

67 lines
1.9 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 217fa0d006cf292e837bab6458b81341718eb35e Maintainer: nilgun Status: ready -->
<chapter xml:id="curl.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<section xml:id="curl.examples-basic">
<title>Temel bir curl örneği</title>
<para>
PHP, cURL desteğiyle derlenmişse cURL işlevleri kullanılabilir.
cURL işlevlerinin kullanım amacı ve sırası, ana hatlarıyla,
<function>curl_init</function> işlevini kullanarak bir cURL
oturumu başlatıp, aktarımın tüm seçeneklerini
<function>curl_setopt</function> ile belirledikten sonra oturumu
<function>curl_exec</function> ile çalıştırıp iş bitince
<function>curl_close</function> ile oturumu sonlandırmak şeklindedir.
Burada, example.com ana sayfasını bir dosyaya aktarmak amacıyla cURL
işlevlerinin kullanımı örneklenmiştir:
<example>
<title>- example.com ana sayfasını bir dosyaya aktarmak amacıyla cURL
işlevlerinin kullanımı</title>
<programlisting role="php">
<![CDATA[
<?php
$ch = curl_init("http://www.example.com/");
$fp = fopen("example_homepage.txt", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
if(curl_error($ch)) {
fwrite($fp, curl_error($ch));
}
curl_close($ch);
fclose($fp);
?>
]]>
</programlisting>
</example>
</para>
</section>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->