mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-25 17:32:07 +01:00
124 lines
3.5 KiB
XML
124 lines
3.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 8cdc6621f9826d04abc3e50438c010804d7e8683 Maintainer: jpauli Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry xml:id="function.strval" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>strval</refname>
|
|
<refpurpose>Récupère la valeur d'une variable, au format chaîne</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>strval</methodname>
|
|
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
Récupère la valeur de la variable <parameter>value</parameter>,
|
|
au format chaîne de caractères. Voir la documentation sur les
|
|
chaînes de caractères pour plus d'informations sur la conversion
|
|
en chaîne.
|
|
</simpara>
|
|
<simpara>
|
|
Cette fonction n'effectue aucun formatage sur la valeur retournée.
|
|
Si vous cherchez un moyen de formatter une valeur numérique en chaîne de
|
|
caractères, reportez-vous à la fonction
|
|
<function>sprintf</function> ou la fonction <function>number_format</function>.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>value</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La variable à convertir en &string;.
|
|
</para>
|
|
<para>
|
|
<parameter>value</parameter> peut être un scalaire ou un objet implémentant la
|
|
méthode magique <link linkend="object.tostring">__toString()</link>.
|
|
Vous ne pouvez pas utiliser la fonction <function>strval</function> avec des tableaux
|
|
ou des objets qui n'implémentent pas la méthode magique
|
|
<link linkend="object.tostring">__toString()</link>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
La valeur de la variable <parameter>value</parameter> sous la forme d'une &string;.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple pour <function>strval</function> utilisant la méthode magique PHP
|
|
<link linkend="object.tostring">__toString()</link>.</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
class StrValTest
|
|
{
|
|
public function __toString()
|
|
{
|
|
return __CLASS__;
|
|
}
|
|
}
|
|
|
|
// Affiche 'StrValTest'
|
|
echo strval(new StrValTest);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>boolval</function></member>
|
|
<member><function>floatval</function></member>
|
|
<member><function>intval</function></member>
|
|
<member><function>settype</function></member>
|
|
<member><function>sprintf</function></member>
|
|
<member><function>number_format</function></member>
|
|
<member><link linkend="language.types.type-juggling">Le transtypage</link></member>
|
|
<member><link linkend="object.tostring">__toString()</link></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
|
|
-->
|