1
0
mirror of https://github.com/php/doc-fr.git synced 2026-03-25 23:52:20 +01:00
Files
archived-doc-fr/reference/array/functions/reset.xml
Yannick Torres b4f209b235 sync with EN
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@172675 c90b9560-bf6c-de11-be94-00142212c4b1
2004-11-14 22:24:17 +00:00

78 lines
1.9 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.14 $ -->
<!-- EN-Revision: 1.13 Maintainer: didou Status: ready -->
<refentry id="function.reset">
<refnamediv>
<refname>reset</refname>
<refpurpose>
Remet le pointeur interne de tableau au début
</refpurpose>
</refnamediv>
<refsect1>
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>reset</methodname>
<methodparam><type>array</type><parameter role="reference">array</parameter></methodparam>
</methodsynopsis>
<para>
<function>reset</function> replace le pointeur de tableau
<parameter>array</parameter> au premier élément et retourne la valeur
du premier élément ou &false; si le tableau est vide.
</para>
<para>
<example>
<title>Exemple avec <function>reset</function></title>
<programlisting role="php">
<![CDATA[
<?php
$array = array('1 kilomètre', '2 kilomètres', '3 kilomètres', '4 kilomètres');
// Par défaut, le pointeur est sur le premier élément
echo current($array) . "<br />\n"; // "1 kilomètre"
// on saute deux kilomètres
next($array);
next($array);
echo current($array) . "<br />\n"; // "3 kilomètres"
// on remet le pointeur au début
reset($array);
echo current($array) . "<br />\n"; // "1 kilomètre"
?>
]]>
</programlisting>
</example>
</para>
<para>
Voir aussi
<function>current</function>,
<function>each</function>,
<function>next</function> et
<function>prev</function>.
</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:"../../../../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
-->