mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-30 04:42:24 +02:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@166928 c90b9560-bf6c-de11-be94-00142212c4b1
89 lines
2.7 KiB
XML
89 lines
2.7 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.12 $ -->
|
|
<!-- EN-Revision: 1.5 Maintainer: dams Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry id="function.define">
|
|
<refnamediv>
|
|
<refname>define</refname>
|
|
<refpurpose>Définit une constante</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>define</methodname>
|
|
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>case_insensitive</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>define</function> définit la constante de nom <parameter>name</parameter>
|
|
et de valeur<parameter>value</parameter>. Voyez la
|
|
<link linkend="language.constants">section sur les constantes</link>
|
|
pour plus de détails sur les constantes.
|
|
</para>
|
|
<para>
|
|
Le nom de la constante est donné par le paramètre
|
|
<parameter>name</parameter> ; sa valeur est donnée par
|
|
<parameter>value</parameter>.
|
|
</para>
|
|
<para>
|
|
Le troisième paramètre optionnel
|
|
<parameter>case_insensitive</parameter> est une valeur booléenne.
|
|
S'il vaut &true;,
|
|
le nom de la constante sera insensible à la casse :
|
|
<literal>CONSTANT</literal> et <literal>Constant</literal>
|
|
représentent des valeurs identiques. Par défaut,
|
|
ces constantes représenteront des valeurs différentes.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Définition d'une constante</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
define ("CONSTANT", "Bonjour à tous.");
|
|
echo CONSTANT; // affiche "Bonjour à tous."
|
|
echo Constant; // affiche "Constant" et une alerte
|
|
|
|
define ("BONJOUR", "Salut toi.",TRUE);
|
|
echo BONJOUR; // affiche "Salut toi."
|
|
echo Bonjour; // affiche "Salut toi."
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
<para>
|
|
Voir aussi
|
|
<function>defined</function>,
|
|
<function>constant</function> et
|
|
la section sur les <link linkend="language.constants">constantes</link>.
|
|
</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
|
|
-->
|