cvs: phpdoc-it /reference/var/functions doubleval.xml empty.xml floatval.xml get-defined-vars.xml get-resource-type.xml gettype.xml intval.xml
| From: | Andrioli Darvin | Date: | Fri, 20 May 2005 12:32:58 +0000 |
| Subject: | cvs: phpdoc-it /reference/var/functions doubleval.xml empty.xml floatval.xml get-defined-vars.xml get-resource-type.xml gettype.xml intval.xml | ||
| Groups: | php.doc.it | ||
| Request: | Send a blank email to doc-it+get-723@lists.php.net to get a copy of this message | ||
darvina Fri May 20 08:32:58 2005 EDT
Modified files:
/phpdoc-it/reference/var/functions doubleval.xml empty.xml
floatval.xml
get-defined-vars.xml
get-resource-type.xml
gettype.xml intval.xml
Log:
Sync to En tree
http://cvs.php.net/diff.php/phpdoc-it/reference/var/functions/doubleval.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/var/functions/doubleval.xml diff -u phpdoc-it/reference/var/functions/doubleval.xml:1.2 phpdoc-it/reference/var/functions/doubleval.xml:1.3 --- phpdoc-it/reference/var/functions/doubleval.xml:1.2 Wed Apr 17 03:08:49 2002 +++ phpdoc-it/reference/var/functions/doubleval.xml Fri May 20 08:32:58 2005 @@ -1,28 +1,45 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/var.xml, last change in rev 1.1 --> -<!-- last change to 'doubleval' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: darvina Status: ready --> -<!-- OLD-Revision: 1.104/EN.1.2 --> - <refentry id="function.doubleval"> - <refnamediv> - <refname>doubleval</refname> - <refpurpose>Alias di <function>floatval</function></refpurpose> - </refnamediv> - <refsect1> - <title>Descrizione</title> - <para> - Questa funzione è un alias di <function>floatval</function>. - </para> - <note> - <para> - Questo alias è una rimanenza dalla ridenominazione di alcune funzioni. Nelle - vecchie versioni di PHP, occorre utilizzare questo alias al posto della funzione - <function>floatval</function>, questo perchè la suddetta funzione non era - disponibile. - </para> - </note> - </refsect1> - </refentry> +<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> +<refentry id="function.doubleval"> + <refnamediv> + <refname>doubleval</refname> + <refpurpose>&Alias; <function>floatval</function></refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <simpara> + &info.function.alias; + <function>floatval</function>. + </simpara> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>4.2.0</entry> + <entry> + <function>doubleval</function> è diventato un alias di + <function>floatval</function>. Prima esisteva solo + <function>doubleval</function>. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-it/reference/var/functions/empty.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-it/reference/var/functions/empty.xml diff -u phpdoc-it/reference/var/functions/empty.xml:1.6 phpdoc-it/reference/var/functions/empty.xml:1.7 --- phpdoc-it/reference/var/functions/empty.xml:1.6 Tue Jun 15 08:18:42 2004 +++ phpdoc-it/reference/var/functions/empty.xml Fri May 20 08:32:58 2005 @@ -1,72 +1,145 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.8 Maintainer: darvina Status: ready --> - <refentry id="function.empty"> - <refnamediv> - <refname>empty</refname> - <refpurpose>Determina se una variabile è valorizzata</refpurpose> - </refnamediv> - <refsect1> - <title>Descrizione</title> - <methodsynopsis> - <type>bool</type><methodname>empty</methodname> - <methodparam><type>mixed</type><parameter>var</parameter></methodparam> - </methodsynopsis> - <para> - La funzione <function>empty</function> restituisce &false; se il parametro - <parameter>var</parameter> non è vuoto e contiene un valore diverso da zero. - In altre parole i valori <literal>""</literal>, <literal>0</literal>, - <literal>"0"</literal>, &null;, &false;, <literal>array()</literal>, - <literal>var $var;</literal>, e gli oggetti con proprietà vuote - sono tutti considerati vuoti. La funzione restituisce &true; - se <parameter>var</parameter> è vuoto. - </para> - <para> - Questo è l'opposto di - <literal>(boolean) <parameter>var</parameter></literal>, tranne che - non viene dato alcun warning quando la variabile non è valorizzata. - Vedere il capitolo <link linkend="language.types.boolean.casting">Conversione a - booleano</link> per maggiori informazioni. - </para> - - <para> - <example> - <title> - Semplici confronti <function>empty</function> / <function>isset</function>. - </title> - <programlisting role="php"> +<!-- EN-Revision: 1.12 Maintainer: darvina Status: ready --> +<refentry id="function.empty"> + <refnamediv> + <refname>empty</refname> + <refpurpose>Determina se una variabile è valorizzata</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>bool</type><methodname>empty</methodname> + <methodparam><type>mixed</type><parameter>var</parameter></methodparam> + </methodsynopsis> + <para> + Determina se una variabile è da considerare vuota. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>var</parameter></term> + <listitem> + <para> + Varibaile da controllare + </para> + <note> + <para> + <function>empty</function> agisce solo su variabili, qualsiasi altra cosa + genera un errore di parsing. In altre parole, il seguente comando non funziona: + <command>empty(trim($name))</command>. + </para> + </note> + <para> + <function>empty</function> è l'opposto di + <literal>(boolean) <parameter>var</parameter></literal>, + tranne che non viene dato alcun warning quando la variabile non è valorizzata. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Restituisce &false; se <parameter>var</parameter> non è vuota + ed ha un valore diverso da zero. + </para> + <para> + I seguenti valori sono considerati vuoti: + <simplelist> + <member><literal>"" (stringa vuota)</literal></member> + <member><literal>0 (0 come intero)</literal></member> + <member><literal>"0" (0 come stringa)</literal></member> + <member>&null;</member> + <member>&false;</member> + <member><literal>array() (matrice vuota)</literal></member> + <member><literal>var $var; (una variabile dichiarata, ma senza valore in una classe)</literal></member> + </simplelist> + </para> + </refsect1> + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>PHP 5</entry> + <entry> + <para> + Dal PHP 5, oggetti privi di proprietà non sono più considerati vuoti. + </para> + </entry> + </row> + <row> + <entry>PHP 4</entry> + <entry> + <para> + Dal PHP 4, la stringa "0" è considerata vuota. + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title> + Semplici confronti + <function>empty</function> / <function>isset</function>. + </title> + <programlisting role="php"> <![CDATA[ <?php $var = 0; -// Valuata come true perchè $var è vuota -if (empty($var)) { // restituisce true - print '$var è uguale a 0 oppure non è definita'; + +// Valutata come true perchè $var è vuota +if (empty($var)) { + echo '$var is either 0, empty, or not set at all'; } + // Valutata come vera perchè $var è impostata -if (!isset($var)) { // restituisce false - print '$var non è definita'; +if (isset($var)) { + echo '$var is set even though it is empty'; } ?> ]]> - </programlisting> - </example> - </para> - ¬e.language-construct; - <note> - <para> - Si noti che la funzione perde di significato se applicata a qualcosa che non sia una - variabile; ad esempio <command>empty (addslashes ($name))</command> non ha significato. - </para> - </note> - <simpara> - Vedere anche <function>isset</function>, - <function>unset</function>, - <function>array_key_exists</function>, - <function>count</function>, - <function>strlen</function> e - <link linkend="types.comparisons">la tabella di comparazione dei tipi</link>. - </simpara> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="notes"> + &reftitle.notes; + ¬e.language-construct; + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>isset</function></member> + <member><function>unset</function></member> + <member><function>array_key_exists</function></member> + <member><function>count</function></member> + <member><function>strlen</function></member> + <member><link linkend="types.comparisons">la tabella di comparazione dei tipi</link></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-it/reference/var/functions/floatval.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-it/reference/var/functions/floatval.xml diff -u phpdoc-it/reference/var/functions/floatval.xml:1.4 phpdoc-it/reference/var/functions/floatval.xml:1.5 --- phpdoc-it/reference/var/functions/floatval.xml:1.4 Fri Jan 9 15:30:29 2004 +++ phpdoc-it/reference/var/functions/floatval.xml Fri May 20 08:32:58 2005 @@ -1,42 +1,71 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> - <refentry id="function.floatval"> - <refnamediv> - <refname>floatval</refname> - <refpurpose>Restituisce il valore di una variabile di tipo float</refpurpose> - </refnamediv> - <refsect1> - <title>Descrizione</title> - <methodsynopsis> - <type>float</type><methodname>floatval</methodname> - <methodparam><type>mixed</type><parameter>var</parameter></methodparam> - </methodsynopsis> - <simpara> - La funzione restituisce il valore di tipo <type>float</type> di <parameter>var</parameter>. - </simpara> - <para> - La variabile <parameter>Var</parameter> può anche essere di tipo scalare. La funzione - <function>floatval</function> non può essere usata con variabili di tipo array oppure object. - <informalexample> - <programlisting role="php"> +<!-- EN-Revision: 1.5 Maintainer: darvina Status: ready --> +<refentry id="function.floatval"> + <refnamediv> + <refname>floatval</refname> + <refpurpose>Restituisce il valore di una variabile di tipo float</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>float</type><methodname>floatval</methodname> + <methodparam><type>mixed</type><parameter>var</parameter></methodparam> + </methodsynopsis> + <para> + La funzione restituisce il valore di tipo <type>float</type> di <parameter>var</parameter>. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>var</parameter></term> + <listitem> + <para> + Può anche essere di tipo scalare. La funzione + <function>floatval</function> non può essere usata con variabili di tipo array oppure object. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Il valore in virgola mobile della variabile. + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Esempio di uso di <function>floatval</function></title> + <programlisting role="php"> <![CDATA[ <?php $var = '122.34343The'; -$valore_float_di_var = floatval($var); -echo $valore_float_di_var; // visualizza 122.34343 +$float_value_of_var = floatval($var); +echo $float_value_of_var; // 122.34343 ?> ]]> - </programlisting> - </informalexample> - </para> - <simpara> - Vedere anche <function>intval</function>, - <function>strval</function>, <function>settype</function> e - <link linkend="language.types.type-juggling">Manipolazione dei Tipi - </link>. - </simpara> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>intval</function></member> + <member><function>strval</function></member> + <member><function>settype</function></member> + <member><link linkend="language.types.type-juggling">Type juggling</link></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-it/reference/var/functions/get-defined-vars.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc-it/reference/var/functions/get-defined-vars.xml diff -u phpdoc-it/reference/var/functions/get-defined-vars.xml:1.7 phpdoc-it/reference/var/functions/get-defined-vars.xml:1.8 --- phpdoc-it/reference/var/functions/get-defined-vars.xml:1.7 Thu Sep 2 08:17:33 2004 +++ phpdoc-it/reference/var/functions/get-defined-vars.xml Fri May 20 08:32:58 2005 @@ -1,26 +1,37 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.8 Maintainer: darvina Status: ready --> - <refentry id="function.get-defined-vars"> - <refnamediv> - <refname>get_defined_vars</refname> - <refpurpose> - Restituisce un'array contenente tutte le variabili definite - </refpurpose> - </refnamediv> - <refsect1> - <title>Descrizione</title> - <methodsynopsis> - <type>array</type><methodname>get_defined_vars</methodname> - <void/> - </methodsynopsis> - <para> - Questa funzione restituisce un'array multidimensionale contenente la lista - di tutte le variabili definite, siano esse d'ambiente, variabili del server - o definite dall'utente. - </para> - <para> - <informalexample> - <programlisting role="php"> +<!-- EN-Revision: 1.11 Maintainer: darvina Status: ready --> +<refentry id="function.get-defined-vars"> + <refnamediv> + <refname>get_defined_vars</refname> + <refpurpose> + Restituisce un'array contenente tutte le variabili definite + </refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>array</type><methodname>get_defined_vars</methodname> + <void/> + </methodsynopsis> + <para> + Questa funzione restituisce un'array multidimensionale contenente la lista + di tutte le variabili definite, siano esse d'ambiente, variabili del server + o definite dall'utente, visibili da dove + <function>get_defined_vars</function> viene eseguito. + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Un'array multidimensionale contenente la lista di tutte le variabili definite. + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Esempio di uso di <function>get_defined_vars</function></title> + <programlisting role="php"> <![CDATA[ <?php $b = array(1, 1, 2, 3, 5, 8); @@ -44,17 +55,45 @@ print_r(array_keys(get_defined_vars())); ?> ]]> - </programlisting> - </informalexample> - </para> - <para> - Vedere anche - <function>isset</function>, - <function>get_defined_functions</function> e - <function>get_defined_constants</function>. - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>5.0.0</entry> + <entry> + La variabile <varname>$GLOBALS</varname> viene compresa nella + matrice restituita. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>isset</function></member> + <member><function>get_defined_functions</function></member> + <member><function>get_defined_constants</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-it/reference/var/functions/get-resource-type.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-it/reference/var/functions/get-resource-type.xml diff -u phpdoc-it/reference/var/functions/get-resource-type.xml:1.5 phpdoc-it/reference/var/functions/get-resource-type.xml:1.6 --- phpdoc-it/reference/var/functions/get-resource-type.xml:1.5 Thu Sep 2 08:17:33 2004 +++ phpdoc-it/reference/var/functions/get-resource-type.xml Fri May 20 08:32:58 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.6 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: darvina Status: ready --> <refentry id="function.get-resource-type"> <refnamediv> <refname>get_resource_type</refname> @@ -7,35 +7,67 @@ Restituisce il tipo di risorsa </refpurpose> </refnamediv> - <refsect1> - <title>Descrizione</title> + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>string</type><methodname>get_resource_type</methodname> <methodparam><type>resource</type><parameter>handle</parameter></methodparam> </methodsynopsis> <para> - Questa funzione restituisce una stringa rappresentante il tipo di - <type>risorsa</type> passato. Se il parametro passato non è una - <type>risorsa</type> valida la funzione genera un - errore. + Questa funzione restituisce il tipo della risorsa data. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>handle</parameter></term> + <listitem> + <para> + Risorsa da valutare. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Se il parametro <parameter>handle</parameter> è una risorsa, questa funzione + restituirà una stringa indicante il tipo di risorsa. Se il tipo non è identificato + dalla funzione, il valore restituito sarà + <literal>Unknown</literal>. </para> <para> - <informalexample> + La funzione restituisce &false; e genera un errore se + <parameter>handle</parameter> non è di tipo <type>resource</type>. + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Esempio di uso di <function>get_resource_type</function></title> <programlisting role="php"> <![CDATA[ <?php +// visualizza: mysql link $c = mysql_connect(); echo get_resource_type($c) . "\n"; + // visualizza: file -$fp = fopen("foo","w"); +$fp = fopen("foo", "w"); echo get_resource_type($fp) . "\n"; + // visualizza: domxml document $doc = new_xmldoc("1.0"); echo get_resource_type($doc->doc) . "\n"; ?> ]]> </programlisting> - </informalexample> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/var/functions/gettype.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-it/reference/var/functions/gettype.xml diff -u phpdoc-it/reference/var/functions/gettype.xml:1.4 phpdoc-it/reference/var/functions/gettype.xml:1.5 --- phpdoc-it/reference/var/functions/gettype.xml:1.4 Fri Jan 9 15:30:29 2004 +++ phpdoc-it/reference/var/functions/gettype.xml Fri May 20 08:32:58 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: darvina Status: ready --> <refentry id="function.gettype"> <refnamediv> <refname>gettype</refname> @@ -58,7 +58,7 @@ <simpara>"user function" (soltanto in PHP 3, deprecated)</simpara> </listitem> <listitem> - <simpara>"unknown type"<!-- someone's joking? --></simpara> + <simpara>"unknown type"</simpara> </listitem> </itemizedlist> </para> @@ -73,7 +73,7 @@ <function>is_array</function>, <function>is_bool</function>, <function>is_float</function>, - <function>is_integer</function>, + <function>is_int</function>, <function>is_null</function>, <function>is_numeric</function>, <function>is_object</function>, http://cvs.php.net/diff.php/phpdoc-it/reference/var/functions/intval.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/var/functions/intval.xml diff -u phpdoc-it/reference/var/functions/intval.xml:1.2 phpdoc-it/reference/var/functions/intval.xml:1.3 --- phpdoc-it/reference/var/functions/intval.xml:1.2 Wed Apr 17 03:08:51 2002 +++ phpdoc-it/reference/var/functions/intval.xml Fri May 20 08:32:58 2005 @@ -1,42 +1,128 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/var.xml, last change in rev 1.1 --> -<!-- last change to 'intval' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: darvina Status: ready --> -<!-- OLD-Revision: 1.104/EN.1.2 --> - <refentry id="function.intval"> - <refnamediv> - <refname>intval</refname> - <refpurpose>Estrae il valore intero da una variabile</refpurpose> - </refnamediv> - <refsect1> - <title>Descrizione</title> - <methodsynopsis> - <type>int</type><methodname>intval</methodname> - <methodparam><type>mixed</type><parameter>var</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>base</parameter></methodparam> - </methodsynopsis> - <simpara> - Estrae il valore intero di <parameter>var</parameter>, - utilizzando la base definita a parametro per la conversione. (La base vale 10 di default). - </simpara> - <simpara> - <parameter>Var</parameter> può essere una qualsiasi variabile scalare. Non è possibile utilizzare - <function>intval</function> con variabili di tipo <type>array</type> o <type>object</type>. - </simpara> - <note> - <para> - Il parametro <parameter>base</parameter> di - <function>intval</function> non ha effetto se - <parameter>var</parameter> non è una stringa. - </para> - </note> - <simpara> - Vedere anche <function>doubleval</function>, - <function>strval</function>, <function>settype</function> e - <link linkend="language.types.type-juggling">Manipolazione dei Tipi</link>. - </simpara> - </refsect1> - </refentry> +<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> +<refentry id="function.intval"> + <refnamediv> + <refname>intval</refname> + <refpurpose>Estrae il valore intero da una variabile</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>int</type><methodname>intval</methodname> + <methodparam><type>mixed</type><parameter>var</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>base</parameter></methodparam> + </methodsynopsis> + <para> + Estrae il valore <type>intero</type> di <parameter>var</parameter>, + utilizzando la <parameter>base</parameter> definita a parametro per la conversione. + (La base vale 10 di default). + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>var</parameter></term> + <listitem> + <para> + Valore scalare da convertire in intero + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>base</parameter></term> + <listitem> + <para> + Base per la conversione (il default è 10) + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Il valore intero di <parameter>var</parameter> se riesce, oppure 0 in caso + di errore. Le matrici e gli oggetti vuoti restituiscono 0, la matrici e gli + oggetti pieni restituiscono 1. + </para> + <para> + Il valore massimo dipende dal sistema. Nei sistemi a 32 bit si ha come + valore per il caso di intero con segno il range da -2147483648 a 2147483647. Così, ad esempio, + su tali sistemi, la riga <literal>intval('1000000000000')</literal> restituirà + 2147483647. Il massimo valore per un intero con segno sui sistemi a 64 bit è + 9223372036854775807. + </para> + <para> + Le stringhe probabilmente restituiranno 0, sebbene il valore restituito dipenda + dal primo carattere a sinistra della stringa. Si utilizzano le + comuni di + <link linkend="language.types.integer.casting">integer casting</link> . + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Esempi di uso di <function>intval</function></title> + <para> + I seguenti esempi sono basati su un sistema a 32 bit. + </para> + <programlisting role="php"> +<![CDATA[ +<?php +echo intval(42); // 42 +echo intval(4.2); // 4 +echo intval('42'); // 42 +echo intval('+42'); // 42 +echo intval('-42'); // -42 +echo intval(042); // 34 +echo intval('042'); // 42 +echo intval(1e10); // 1410065408 +echo intval('1e10'); // 1 +echo intval(0x1A); // 26 +echo intval(42000000); // 42000000 +echo intval(420000000000000000000); // 0 +echo intval('420000000000000000000'); // 2147483647 +echo intval(42, 8); // 42 +echo intval('42', 8); // 34 +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + Il parametro <parameter>base</parameter> non ha influenza a meno che il parametro + <parameter>var</parameter> non sia una stringa. + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>floatval</function></member> + <member><function>strval</function></member> + <member><function>settype</function></member> + <member><function>is_numeric</function></member> + <member><link linkend="language.types.type-juggling">Type juggling</link></member> + <member><link linkend="ref.bc">BCMath Arbitrary Precision Mathematics Functions</link></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables:
http://cvs.php.net/diff.php/phpdoc-it/reference/var/functions/doubleval.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/var/functions/doubleval.xml diff -u phpdoc-it/reference/var/functions/doubleval.xml:1.2 phpdoc-it/reference/var/functions/doubleval.xml:1.3 --- phpdoc-it/reference/var/functions/doubleval.xml:1.2 Wed Apr 17 03:08:49 2002 +++ phpdoc-it/reference/var/functions/doubleval.xml Fri May 20 08:32:58 2005 @@ -1,28 +1,45 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/var.xml, last change in rev 1.1 --> -<!-- last change to 'doubleval' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: darvina Status: ready --> -<!-- OLD-Revision: 1.104/EN.1.2 --> - <refentry id="function.doubleval"> - <refnamediv> - <refname>doubleval</refname> - <refpurpose>Alias di <function>floatval</function></refpurpose> - </refnamediv> - <refsect1> - <title>Descrizione</title> - <para> - Questa funzione è un alias di <function>floatval</function>. - </para> - <note> - <para> - Questo alias è una rimanenza dalla ridenominazione di alcune funzioni. Nelle - vecchie versioni di PHP, occorre utilizzare questo alias al posto della funzione - <function>floatval</function>, questo perchè la suddetta funzione non era - disponibile. - </para> - </note> - </refsect1> - </refentry> +<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> +<refentry id="function.doubleval"> + <refnamediv> + <refname>doubleval</refname> + <refpurpose>&Alias; <function>floatval</function></refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <simpara> + &info.function.alias; + <function>floatval</function>. + </simpara> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>4.2.0</entry> + <entry> + <function>doubleval</function> è diventato un alias di + <function>floatval</function>. Prima esisteva solo + <function>doubleval</function>. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-it/reference/var/functions/empty.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-it/reference/var/functions/empty.xml diff -u phpdoc-it/reference/var/functions/empty.xml:1.6 phpdoc-it/reference/var/functions/empty.xml:1.7 --- phpdoc-it/reference/var/functions/empty.xml:1.6 Tue Jun 15 08:18:42 2004 +++ phpdoc-it/reference/var/functions/empty.xml Fri May 20 08:32:58 2005 @@ -1,72 +1,145 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.8 Maintainer: darvina Status: ready --> - <refentry id="function.empty"> - <refnamediv> - <refname>empty</refname> - <refpurpose>Determina se una variabile è valorizzata</refpurpose> - </refnamediv> - <refsect1> - <title>Descrizione</title> - <methodsynopsis> - <type>bool</type><methodname>empty</methodname> - <methodparam><type>mixed</type><parameter>var</parameter></methodparam> - </methodsynopsis> - <para> - La funzione <function>empty</function> restituisce &false; se il parametro - <parameter>var</parameter> non è vuoto e contiene un valore diverso da zero. - In altre parole i valori <literal>""</literal>, <literal>0</literal>, - <literal>"0"</literal>, &null;, &false;, <literal>array()</literal>, - <literal>var $var;</literal>, e gli oggetti con proprietà vuote - sono tutti considerati vuoti. La funzione restituisce &true; - se <parameter>var</parameter> è vuoto. - </para> - <para> - Questo è l'opposto di - <literal>(boolean) <parameter>var</parameter></literal>, tranne che - non viene dato alcun warning quando la variabile non è valorizzata. - Vedere il capitolo <link linkend="language.types.boolean.casting">Conversione a - booleano</link> per maggiori informazioni. - </para> - - <para> - <example> - <title> - Semplici confronti <function>empty</function> / <function>isset</function>. - </title> - <programlisting role="php"> +<!-- EN-Revision: 1.12 Maintainer: darvina Status: ready --> +<refentry id="function.empty"> + <refnamediv> + <refname>empty</refname> + <refpurpose>Determina se una variabile è valorizzata</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>bool</type><methodname>empty</methodname> + <methodparam><type>mixed</type><parameter>var</parameter></methodparam> + </methodsynopsis> + <para> + Determina se una variabile è da considerare vuota. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>var</parameter></term> + <listitem> + <para> + Varibaile da controllare + </para> + <note> + <para> + <function>empty</function> agisce solo su variabili, qualsiasi altra cosa + genera un errore di parsing. In altre parole, il seguente comando non funziona: + <command>empty(trim($name))</command>. + </para> + </note> + <para> + <function>empty</function> è l'opposto di + <literal>(boolean) <parameter>var</parameter></literal>, + tranne che non viene dato alcun warning quando la variabile non è valorizzata. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Restituisce &false; se <parameter>var</parameter> non è vuota + ed ha un valore diverso da zero. + </para> + <para> + I seguenti valori sono considerati vuoti: + <simplelist> + <member><literal>"" (stringa vuota)</literal></member> + <member><literal>0 (0 come intero)</literal></member> + <member><literal>"0" (0 come stringa)</literal></member> + <member>&null;</member> + <member>&false;</member> + <member><literal>array() (matrice vuota)</literal></member> + <member><literal>var $var; (una variabile dichiarata, ma senza valore in una classe)</literal></member> + </simplelist> + </para> + </refsect1> + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>PHP 5</entry> + <entry> + <para> + Dal PHP 5, oggetti privi di proprietà non sono più considerati vuoti. + </para> + </entry> + </row> + <row> + <entry>PHP 4</entry> + <entry> + <para> + Dal PHP 4, la stringa "0" è considerata vuota. + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title> + Semplici confronti + <function>empty</function> / <function>isset</function>. + </title> + <programlisting role="php"> <![CDATA[ <?php $var = 0; -// Valuata come true perchè $var è vuota -if (empty($var)) { // restituisce true - print '$var è uguale a 0 oppure non è definita'; + +// Valutata come true perchè $var è vuota +if (empty($var)) { + echo '$var is either 0, empty, or not set at all'; } + // Valutata come vera perchè $var è impostata -if (!isset($var)) { // restituisce false - print '$var non è definita'; +if (isset($var)) { + echo '$var is set even though it is empty'; } ?> ]]> - </programlisting> - </example> - </para> - ¬e.language-construct; - <note> - <para> - Si noti che la funzione perde di significato se applicata a qualcosa che non sia una - variabile; ad esempio <command>empty (addslashes ($name))</command> non ha significato. - </para> - </note> - <simpara> - Vedere anche <function>isset</function>, - <function>unset</function>, - <function>array_key_exists</function>, - <function>count</function>, - <function>strlen</function> e - <link linkend="types.comparisons">la tabella di comparazione dei tipi</link>. - </simpara> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="notes"> + &reftitle.notes; + ¬e.language-construct; + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>isset</function></member> + <member><function>unset</function></member> + <member><function>array_key_exists</function></member> + <member><function>count</function></member> + <member><function>strlen</function></member> + <member><link linkend="types.comparisons">la tabella di comparazione dei tipi</link></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-it/reference/var/functions/floatval.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-it/reference/var/functions/floatval.xml diff -u phpdoc-it/reference/var/functions/floatval.xml:1.4 phpdoc-it/reference/var/functions/floatval.xml:1.5 --- phpdoc-it/reference/var/functions/floatval.xml:1.4 Fri Jan 9 15:30:29 2004 +++ phpdoc-it/reference/var/functions/floatval.xml Fri May 20 08:32:58 2005 @@ -1,42 +1,71 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> - <refentry id="function.floatval"> - <refnamediv> - <refname>floatval</refname> - <refpurpose>Restituisce il valore di una variabile di tipo float</refpurpose> - </refnamediv> - <refsect1> - <title>Descrizione</title> - <methodsynopsis> - <type>float</type><methodname>floatval</methodname> - <methodparam><type>mixed</type><parameter>var</parameter></methodparam> - </methodsynopsis> - <simpara> - La funzione restituisce il valore di tipo <type>float</type> di <parameter>var</parameter>. - </simpara> - <para> - La variabile <parameter>Var</parameter> può anche essere di tipo scalare. La funzione - <function>floatval</function> non può essere usata con variabili di tipo array oppure object. - <informalexample> - <programlisting role="php"> +<!-- EN-Revision: 1.5 Maintainer: darvina Status: ready --> +<refentry id="function.floatval"> + <refnamediv> + <refname>floatval</refname> + <refpurpose>Restituisce il valore di una variabile di tipo float</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>float</type><methodname>floatval</methodname> + <methodparam><type>mixed</type><parameter>var</parameter></methodparam> + </methodsynopsis> + <para> + La funzione restituisce il valore di tipo <type>float</type> di <parameter>var</parameter>. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>var</parameter></term> + <listitem> + <para> + Può anche essere di tipo scalare. La funzione + <function>floatval</function> non può essere usata con variabili di tipo array oppure object. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Il valore in virgola mobile della variabile. + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Esempio di uso di <function>floatval</function></title> + <programlisting role="php"> <![CDATA[ <?php $var = '122.34343The'; -$valore_float_di_var = floatval($var); -echo $valore_float_di_var; // visualizza 122.34343 +$float_value_of_var = floatval($var); +echo $float_value_of_var; // 122.34343 ?> ]]> - </programlisting> - </informalexample> - </para> - <simpara> - Vedere anche <function>intval</function>, - <function>strval</function>, <function>settype</function> e - <link linkend="language.types.type-juggling">Manipolazione dei Tipi - </link>. - </simpara> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>intval</function></member> + <member><function>strval</function></member> + <member><function>settype</function></member> + <member><link linkend="language.types.type-juggling">Type juggling</link></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-it/reference/var/functions/get-defined-vars.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc-it/reference/var/functions/get-defined-vars.xml diff -u phpdoc-it/reference/var/functions/get-defined-vars.xml:1.7 phpdoc-it/reference/var/functions/get-defined-vars.xml:1.8 --- phpdoc-it/reference/var/functions/get-defined-vars.xml:1.7 Thu Sep 2 08:17:33 2004 +++ phpdoc-it/reference/var/functions/get-defined-vars.xml Fri May 20 08:32:58 2005 @@ -1,26 +1,37 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.8 Maintainer: darvina Status: ready --> - <refentry id="function.get-defined-vars"> - <refnamediv> - <refname>get_defined_vars</refname> - <refpurpose> - Restituisce un'array contenente tutte le variabili definite - </refpurpose> - </refnamediv> - <refsect1> - <title>Descrizione</title> - <methodsynopsis> - <type>array</type><methodname>get_defined_vars</methodname> - <void/> - </methodsynopsis> - <para> - Questa funzione restituisce un'array multidimensionale contenente la lista - di tutte le variabili definite, siano esse d'ambiente, variabili del server - o definite dall'utente. - </para> - <para> - <informalexample> - <programlisting role="php"> +<!-- EN-Revision: 1.11 Maintainer: darvina Status: ready --> +<refentry id="function.get-defined-vars"> + <refnamediv> + <refname>get_defined_vars</refname> + <refpurpose> + Restituisce un'array contenente tutte le variabili definite + </refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>array</type><methodname>get_defined_vars</methodname> + <void/> + </methodsynopsis> + <para> + Questa funzione restituisce un'array multidimensionale contenente la lista + di tutte le variabili definite, siano esse d'ambiente, variabili del server + o definite dall'utente, visibili da dove + <function>get_defined_vars</function> viene eseguito. + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Un'array multidimensionale contenente la lista di tutte le variabili definite. + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Esempio di uso di <function>get_defined_vars</function></title> + <programlisting role="php"> <![CDATA[ <?php $b = array(1, 1, 2, 3, 5, 8); @@ -44,17 +55,45 @@ print_r(array_keys(get_defined_vars())); ?> ]]> - </programlisting> - </informalexample> - </para> - <para> - Vedere anche - <function>isset</function>, - <function>get_defined_functions</function> e - <function>get_defined_constants</function>. - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>5.0.0</entry> + <entry> + La variabile <varname>$GLOBALS</varname> viene compresa nella + matrice restituita. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>isset</function></member> + <member><function>get_defined_functions</function></member> + <member><function>get_defined_constants</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-it/reference/var/functions/get-resource-type.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-it/reference/var/functions/get-resource-type.xml diff -u phpdoc-it/reference/var/functions/get-resource-type.xml:1.5 phpdoc-it/reference/var/functions/get-resource-type.xml:1.6 --- phpdoc-it/reference/var/functions/get-resource-type.xml:1.5 Thu Sep 2 08:17:33 2004 +++ phpdoc-it/reference/var/functions/get-resource-type.xml Fri May 20 08:32:58 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.6 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: darvina Status: ready --> <refentry id="function.get-resource-type"> <refnamediv> <refname>get_resource_type</refname> @@ -7,35 +7,67 @@ Restituisce il tipo di risorsa </refpurpose> </refnamediv> - <refsect1> - <title>Descrizione</title> + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>string</type><methodname>get_resource_type</methodname> <methodparam><type>resource</type><parameter>handle</parameter></methodparam> </methodsynopsis> <para> - Questa funzione restituisce una stringa rappresentante il tipo di - <type>risorsa</type> passato. Se il parametro passato non è una - <type>risorsa</type> valida la funzione genera un - errore. + Questa funzione restituisce il tipo della risorsa data. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>handle</parameter></term> + <listitem> + <para> + Risorsa da valutare. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Se il parametro <parameter>handle</parameter> è una risorsa, questa funzione + restituirà una stringa indicante il tipo di risorsa. Se il tipo non è identificato + dalla funzione, il valore restituito sarà + <literal>Unknown</literal>. </para> <para> - <informalexample> + La funzione restituisce &false; e genera un errore se + <parameter>handle</parameter> non è di tipo <type>resource</type>. + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Esempio di uso di <function>get_resource_type</function></title> <programlisting role="php"> <![CDATA[ <?php +// visualizza: mysql link $c = mysql_connect(); echo get_resource_type($c) . "\n"; + // visualizza: file -$fp = fopen("foo","w"); +$fp = fopen("foo", "w"); echo get_resource_type($fp) . "\n"; + // visualizza: domxml document $doc = new_xmldoc("1.0"); echo get_resource_type($doc->doc) . "\n"; ?> ]]> </programlisting> - </informalexample> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/var/functions/gettype.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-it/reference/var/functions/gettype.xml diff -u phpdoc-it/reference/var/functions/gettype.xml:1.4 phpdoc-it/reference/var/functions/gettype.xml:1.5 --- phpdoc-it/reference/var/functions/gettype.xml:1.4 Fri Jan 9 15:30:29 2004 +++ phpdoc-it/reference/var/functions/gettype.xml Fri May 20 08:32:58 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: darvina Status: ready --> <refentry id="function.gettype"> <refnamediv> <refname>gettype</refname> @@ -58,7 +58,7 @@ <simpara>"user function" (soltanto in PHP 3, deprecated)</simpara> </listitem> <listitem> - <simpara>"unknown type"<!-- someone's joking? --></simpara> + <simpara>"unknown type"</simpara> </listitem> </itemizedlist> </para> @@ -73,7 +73,7 @@ <function>is_array</function>, <function>is_bool</function>, <function>is_float</function>, - <function>is_integer</function>, + <function>is_int</function>, <function>is_null</function>, <function>is_numeric</function>, <function>is_object</function>, http://cvs.php.net/diff.php/phpdoc-it/reference/var/functions/intval.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/var/functions/intval.xml diff -u phpdoc-it/reference/var/functions/intval.xml:1.2 phpdoc-it/reference/var/functions/intval.xml:1.3 --- phpdoc-it/reference/var/functions/intval.xml:1.2 Wed Apr 17 03:08:51 2002 +++ phpdoc-it/reference/var/functions/intval.xml Fri May 20 08:32:58 2005 @@ -1,42 +1,128 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/var.xml, last change in rev 1.1 --> -<!-- last change to 'intval' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: darvina Status: ready --> -<!-- OLD-Revision: 1.104/EN.1.2 --> - <refentry id="function.intval"> - <refnamediv> - <refname>intval</refname> - <refpurpose>Estrae il valore intero da una variabile</refpurpose> - </refnamediv> - <refsect1> - <title>Descrizione</title> - <methodsynopsis> - <type>int</type><methodname>intval</methodname> - <methodparam><type>mixed</type><parameter>var</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>base</parameter></methodparam> - </methodsynopsis> - <simpara> - Estrae il valore intero di <parameter>var</parameter>, - utilizzando la base definita a parametro per la conversione. (La base vale 10 di default). - </simpara> - <simpara> - <parameter>Var</parameter> può essere una qualsiasi variabile scalare. Non è possibile utilizzare - <function>intval</function> con variabili di tipo <type>array</type> o <type>object</type>. - </simpara> - <note> - <para> - Il parametro <parameter>base</parameter> di - <function>intval</function> non ha effetto se - <parameter>var</parameter> non è una stringa. - </para> - </note> - <simpara> - Vedere anche <function>doubleval</function>, - <function>strval</function>, <function>settype</function> e - <link linkend="language.types.type-juggling">Manipolazione dei Tipi</link>. - </simpara> - </refsect1> - </refentry> +<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> +<refentry id="function.intval"> + <refnamediv> + <refname>intval</refname> + <refpurpose>Estrae il valore intero da una variabile</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>int</type><methodname>intval</methodname> + <methodparam><type>mixed</type><parameter>var</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>base</parameter></methodparam> + </methodsynopsis> + <para> + Estrae il valore <type>intero</type> di <parameter>var</parameter>, + utilizzando la <parameter>base</parameter> definita a parametro per la conversione. + (La base vale 10 di default). + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>var</parameter></term> + <listitem> + <para> + Valore scalare da convertire in intero + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>base</parameter></term> + <listitem> + <para> + Base per la conversione (il default è 10) + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Il valore intero di <parameter>var</parameter> se riesce, oppure 0 in caso + di errore. Le matrici e gli oggetti vuoti restituiscono 0, la matrici e gli + oggetti pieni restituiscono 1. + </para> + <para> + Il valore massimo dipende dal sistema. Nei sistemi a 32 bit si ha come + valore per il caso di intero con segno il range da -2147483648 a 2147483647. Così, ad esempio, + su tali sistemi, la riga <literal>intval('1000000000000')</literal> restituirà + 2147483647. Il massimo valore per un intero con segno sui sistemi a 64 bit è + 9223372036854775807. + </para> + <para> + Le stringhe probabilmente restituiranno 0, sebbene il valore restituito dipenda + dal primo carattere a sinistra della stringa. Si utilizzano le + comuni di + <link linkend="language.types.integer.casting">integer casting</link> . + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Esempi di uso di <function>intval</function></title> + <para> + I seguenti esempi sono basati su un sistema a 32 bit. + </para> + <programlisting role="php"> +<![CDATA[ +<?php +echo intval(42); // 42 +echo intval(4.2); // 4 +echo intval('42'); // 42 +echo intval('+42'); // 42 +echo intval('-42'); // -42 +echo intval(042); // 34 +echo intval('042'); // 42 +echo intval(1e10); // 1410065408 +echo intval('1e10'); // 1 +echo intval(0x1A); // 26 +echo intval(42000000); // 42000000 +echo intval(420000000000000000000); // 0 +echo intval('420000000000000000000'); // 2147483647 +echo intval(42, 8); // 42 +echo intval('42', 8); // 34 +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + Il parametro <parameter>base</parameter> non ha influenza a meno che il parametro + <parameter>var</parameter> non sia una stringa. + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>floatval</function></member> + <member><function>strval</function></member> + <member><function>settype</function></member> + <member><function>is_numeric</function></member> + <member><link linkend="language.types.type-juggling">Type juggling</link></member> + <member><link linkend="ref.bc">BCMath Arbitrary Precision Mathematics Functions</link></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: