1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-26 08:42:13 +01:00
Files
archived-doc-ru/reference/curl/functions/curl-setopt-array.xml
Sergey Panteleev 6d43fd64d7 Исправление форматирования
[skip-spellcheck]
[skip-lint]
2022-12-27 03:42:36 +03:00

144 lines
4.5 KiB
XML
Raw 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"?>
<!-- EN-Revision: 184f3f7bd45643cb80f828d0bb001991ec3a5fad Maintainer: shein Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.curl-setopt-array" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>curl_setopt_array</refname>
<refpurpose>Устанавливает несколько параметров для сеанса cURL</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>curl_setopt_array</methodname>
<methodparam><type>CurlHandle</type><parameter>handle</parameter></methodparam>
<methodparam><type>array</type><parameter>options</parameter></methodparam>
</methodsynopsis>
<para>
Устанавливает несколько параметров для сеанса cURL. Эта
функция полезна при установке большого количества cURL-параметров
без необходимости постоянно вызывать <function>curl_setopt</function>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&curl.ch.description;
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
Массив (<type>array</type>), определяющий устанавливаемые параметры
и их значения. Ключи должны быть корректными константами для
функции <function>curl_setopt</function> или их целочисленными
эквивалентами.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает &true;, если все параметры были успешно установлены.
Если не удалось успешно установить какой-либо параметр,
немедленно возвращается значение &false;, а последующие параметры
в массиве <parameter>options</parameter> будут проигнорированы.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
&curl.changelog.handle-param;
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>
Инициализация новой сессии cURL и загрузка веб-страницы
</title>
<programlisting role="php">
<![CDATA[
<?php
// создание нового ресурса cURL
$ch = curl_init();
// установка URL и других соответствующих параметров
$options = array(CURLOPT_URL => 'http://www.example.com/',
CURLOPT_HEADER => false
);
curl_setopt_array($ch, $options);
// загрузка URL и её выдача в браузер
curl_exec($ch);
// закрытие ресурса cURL и освобождение системных ресурсов
curl_close($ch);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
Как и при работе с <function>curl_setopt</function>, передача массива
в параметр <constant>CURLOPT_POST</constant> закодирует все данные
с помощью <emphasis>multipart/form-data</emphasis>, тогда как
передача URL-кодированной строки будет использовать кодировку
<emphasis>application/x-www-form-urlencoded</emphasis>.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>curl_setopt</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- 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
-->