Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions reference/array/functions/array-first.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 85c47f89f35f927d7c7ad23235c830dc4b514ddd Maintainer: Fan2Shrek Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="function.array-first" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>array_first</refname>
<refpurpose>Renvoie la première valeur d'un tableau</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>array_first</methodname>
<methodparam><type>array</type><parameter>array</parameter></methodparam>
</methodsynopsis>
<para>
Renvoie la première valeur du <parameter>array</parameter> donné.
</para>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>array</parameter></term>
<listitem>
<para>
Un tableau.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Renvoie la première valeur du <parameter>array</parameter> donné si le tableau n'est pas vide;
sinon &null;.
</para>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<para>
<example xml:id="array_first.example.basic">
<title>Utilisation basique de <function>array_first</function></title>
<programlisting role="php">
<![CDATA[
<?php
$array = [1 => 'a', 0 => 'b', 3 => 'c', 2 => 'd'];

$firstValue = array_first($array);

var_dump($firstValue);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
string(1) "a"
]]>
</screen>
</example>
</para>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>array_key_first</function></member>
<member><function>array_last</function></member>
</simplelist>
</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
-->
97 changes: 97 additions & 0 deletions reference/array/functions/array-last.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 85c47f89f35f927d7c7ad23235c830dc4b514ddd Maintainer: Fan2Shrek Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="function.array-last" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>array_last</refname>
<refpurpose>Renvoie la dernière valeur d'un tableau</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>array_last</methodname>
<methodparam><type>array</type><parameter>array</parameter></methodparam>
</methodsynopsis>
<para>
Renvoie la dernière valeur du <parameter>array</parameter> donné.
</para>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>array</parameter></term>
<listitem>
<para>
Un tableau.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Renvoie la dernière valeur du <parameter>array</parameter> donné si le tableau n'est pas vide;
sinon &null;.
</para>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<para>
<example xml:id="array_last.example.basic">
<title>Utilisation basique de <function>array_last</function></title>
<programlisting role="php">
<![CDATA[
<?php
$array = [1 => 'a', 0 => 'b', 3 => 'c', 2 => 'd'];

$lastValue = array_last($array);

var_dump($lastValue);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
string(1) "d"
]]>
</screen>
</example>
</para>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>array_key_last</function></member>
<member><function>array_first</function></member>
</simplelist>
</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
-->