cvs: phpdoc-it /reference/var ini.xml /reference/var/functions floatval.xml get-defined-vars.xml get-resource-type.xml gettype.xml
import-request-variables.xml is-bool.xml is-callable.xml is-resource.xml is-scalar.xml isset.xml print-r.xml serialize.xml unserialize.xml unset.xml
var-dump.xml var-export.xml
| From: | Andrioli Darvin | Date: | Fri, 09 Jan 2004 20:30:29 +0000 |
| Subject: | cvs: phpdoc-it /reference/var ini.xml /reference/var/functions floatval.xml get-defined-vars.xml get-resource-type.xml gettype.xml import-request-variables.xml is-bool.xml is-callable.xml is-resource.xml is-scalar.xml isset.xml print-r.xml serialize.xml unserialize.xml unset.xml var-dump.xml var-export.xml |
||
| Groups: | php.doc.it | ||
| Request: | Send a blank email to doc-it+get-494@lists.php.net to get a copy of this message | ||
darvina Fri Jan 9 15:30:29 2004 EDT
Modified files:
/phpdoc-it/reference/var ini.xml
/phpdoc-it/reference/var/functions floatval.xml
get-defined-vars.xml
get-resource-type.xml
gettype.xml
import-request-variables.xml
is-bool.xml is-callable.xml
is-resource.xml is-scalar.xml
isset.xml print-r.xml
serialize.xml unserialize.xml
unset.xml var-dump.xml
var-export.xml
Log:
Sync to En tree
Index: phpdoc-it/reference/var/ini.xml diff -u phpdoc-it/reference/var/ini.xml:1.2 phpdoc-it/reference/var/ini.xml:1.3 --- phpdoc-it/reference/var/ini.xml:1.2 Mon May 5 15:54:17 2003 +++ phpdoc-it/reference/var/ini.xml Fri Jan 9 15:30:28 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: darvina Status: ready --> <section id="var.configuration"> &reftitle.runtime; &extension.runtime; Index: phpdoc-it/reference/var/functions/floatval.xml diff -u phpdoc-it/reference/var/functions/floatval.xml:1.3 phpdoc-it/reference/var/functions/floatval.xml:1.4 --- phpdoc-it/reference/var/functions/floatval.xml:1.3 Fri Jun 6 16:16:12 2003 +++ phpdoc-it/reference/var/functions/floatval.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> <refentry id="function.floatval"> <refnamediv> <refname>floatval</refname> @@ -22,8 +22,8 @@ <![CDATA[ <?php $var = '122.34343The'; -$valore_float_di_var = floatval ($var); -print $valore_float_di_var; // visualizza 122.34343 +$valore_float_di_var = floatval($var); +echo $valore_float_di_var; // visualizza 122.34343 ?> ]]> </programlisting> Index: phpdoc-it/reference/var/functions/get-defined-vars.xml diff -u phpdoc-it/reference/var/functions/get-defined-vars.xml:1.4 phpdoc-it/reference/var/functions/get-defined-vars.xml:1.5 --- phpdoc-it/reference/var/functions/get-defined-vars.xml:1.4 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/get-defined-vars.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.5 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: darvina Status: ready --> <refentry id="function.get-defined-vars"> <refnamediv> <refname>get_defined_vars</refname> @@ -23,7 +23,7 @@ <programlisting role="php"> <![CDATA[ <?php -$b = array(1,1,2,3,5,8); +$b = array(1, 1, 2, 3, 5, 8); $arr = get_defined_vars(); Index: phpdoc-it/reference/var/functions/get-resource-type.xml diff -u phpdoc-it/reference/var/functions/get-resource-type.xml:1.3 phpdoc-it/reference/var/functions/get-resource-type.xml:1.4 --- phpdoc-it/reference/var/functions/get-resource-type.xml:1.3 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/get-resource-type.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: darvina Status: ready --> <refentry id="function.get-resource-type"> <refnamediv> <refname>get_resource_type</refname> @@ -25,13 +25,13 @@ <![CDATA[ <?php $c = mysql_connect(); -echo get_resource_type($c)."\n"; +echo get_resource_type($c) . "\n"; // visualizza: file $fp = fopen("foo","w"); -echo get_resource_type($fp)."\n"; +echo get_resource_type($fp) . "\n"; // visualizza: domxml document $doc = new_xmldoc("1.0"); -echo get_resource_type($doc->doc)."\n"; +echo get_resource_type($doc->doc) . "\n"; ?> ]]> </programlisting> Index: phpdoc-it/reference/var/functions/gettype.xml diff -u phpdoc-it/reference/var/functions/gettype.xml:1.3 phpdoc-it/reference/var/functions/gettype.xml:1.4 --- phpdoc-it/reference/var/functions/gettype.xml:1.3 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/gettype.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> <refentry id="function.gettype"> <refnamediv> <refname>gettype</refname> Index: phpdoc-it/reference/var/functions/import-request-variables.xml diff -u phpdoc-it/reference/var/functions/import-request-variables.xml:1.5 phpdoc-it/reference/var/functions/import-request-variables.xml:1.6 --- phpdoc-it/reference/var/functions/import-request-variables.xml:1.5 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/import-request-variables.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.9 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.10 Maintainer: darvina Status: ready --> <refentry id="function.import-request-variables"> <refnamediv> <refname>import_request_variables</refname> @@ -60,7 +60,7 @@ // con il prefisso "rvar_" import_request_variables("gP", "rvar_"); -print $rvar_foo; +echo $rvar_foo; ?> ]]> </programlisting> Index: phpdoc-it/reference/var/functions/is-bool.xml diff -u phpdoc-it/reference/var/functions/is-bool.xml:1.3 phpdoc-it/reference/var/functions/is-bool.xml:1.4 --- phpdoc-it/reference/var/functions/is-bool.xml:1.3 Mon Feb 24 15:52:41 2003 +++ phpdoc-it/reference/var/functions/is-bool.xml Fri Jan 9 15:30:29 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/var.xml, last change in rev 1.4 --> <!-- last change to 'is-bool' in en/ tree in rev 1.19 --> -<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: darvina Status: ready --> <!-- OLD-Revision: 1.104/EN.1.19 --> <refentry id="function.is-bool"> <refnamediv> @@ -31,12 +31,12 @@ // Poichè $a è booleana, questa è vera if (is_bool($a)) { - print "Sì, è booleana"; + echo "Sì, è booleana"; } // Poichè $b non è booleana, questa non è vera if (is_bool($b)) { - print "Sì, è booleana"; + echo "Sì, è booleana"; } ?> ]]> Index: phpdoc-it/reference/var/functions/is-callable.xml diff -u phpdoc-it/reference/var/functions/is-callable.xml:1.4 phpdoc-it/reference/var/functions/is-callable.xml:1.5 --- phpdoc-it/reference/var/functions/is-callable.xml:1.4 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/is-callable.xml Fri Jan 9 15:30:29 2004 @@ -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.is-callable"> <refnamediv> <refname>is_callable</refname> @@ -41,7 +41,7 @@ il richiamo ad un metodo statico, questo non è il caso. </para> <informalexample> - <programlisting> + <programlisting role="php"> <![CDATA[ <?php // Come verificare se una variabile può essere eseguita @@ -56,7 +56,7 @@ $functionVariable = 'unaFunzione'; -var_dump( is_callable( $functionVariable, false, $callable_name )); // bool(true) +var_dump(is_callable( $functionVariable, false, $callable_name )); // bool(true) echo $callable_name, "\n"; // unaFunzione @@ -72,13 +72,9 @@ } $anObject = new unaClasse(); - -$methodVariable = array( $anObject, 'unMetodo' ); - -var_dump( is_callable( $methodVariable, true, $callable_name )); // bool(true) - +$methodVariable = array($anObject, 'unMetodo' ); +var_dump(is_callable($methodVariable, true, $callable_name )); // bool(true) echo $callable_name, "\n"; // unaClasse:unMetodo - ?> ]]> </programlisting> Index: phpdoc-it/reference/var/functions/is-resource.xml diff -u phpdoc-it/reference/var/functions/is-resource.xml:1.2 phpdoc-it/reference/var/functions/is-resource.xml:1.3 --- phpdoc-it/reference/var/functions/is-resource.xml:1.2 Wed Apr 17 03:08:52 2002 +++ phpdoc-it/reference/var/functions/is-resource.xml Fri Jan 9 15:30:29 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/var.xml, last change in rev 1.16 --> <!-- last change to 'is-resource' in en/ tree in rev 1.19 --> -<!-- EN-Revision: 1.2 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: darvina Status: ready --> <!-- OLD-Revision: 1.104/EN.1.19 --> <refentry id="function.is-resource"> <refnamediv> @@ -22,6 +22,22 @@ altrimenti restituisce &false;. </para> <para> + <example> + <title>Utilizzo di <function>is_resource</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +$db_link = @mysql_connect('localhost', 'mysql_user', 'mysql_pass'); +if (!is_resource($db_link)) { + die('Can\'t connect : ' . mysql_error()); +} +?> +]]> + </programlisting> + </example> + </para> + <para> Per maggiori dettagli fare riferimento alla documentazione di <type>resource</type>-type </para> Index: phpdoc-it/reference/var/functions/is-scalar.xml diff -u phpdoc-it/reference/var/functions/is-scalar.xml:1.3 phpdoc-it/reference/var/functions/is-scalar.xml:1.4 --- phpdoc-it/reference/var/functions/is-scalar.xml:1.3 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/is-scalar.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> <refentry id="function.is-scalar"> <refnamediv> <refname>is_scalar</refname> Index: phpdoc-it/reference/var/functions/isset.xml diff -u phpdoc-it/reference/var/functions/isset.xml:1.6 phpdoc-it/reference/var/functions/isset.xml:1.7 --- phpdoc-it/reference/var/functions/isset.xml:1.6 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/isset.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.11 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.12 Maintainer: darvina Status: ready --> <refentry id="function.isset"> <refnamediv> <refname>isset</refname> @@ -43,7 +43,7 @@ // Questo test sarà &true; pertanto sarà visualizzato il testo. if (isset($var)) { - print "Questa variabile è valorizzata, pertanto scrivo."; + echo "Questa variabile è valorizzata, pertanto scrivo."; } // Nel prossimo esempio useremo var_dump per visualizzare @@ -52,16 +52,16 @@ $a = "test"; $b = "anothertest"; -var_dump( isset($a) ); // TRUE -var_dump( isset ($a, $b) ); // TRUE +var_dump(isset($a)); // TRUE +var_dump(isset($a, $b)); // TRUE unset ($a); -var_dump( isset ($a) ); // FALSE -var_dump( isset ($a, $b) ); // FALSE +var_dump(isset($a)); // FALSE +var_dump(isset($a, $b)); // FALSE $foo = NULL; -var_dump( isset ($foo) ); // FALSE +var_dump(isset($foo)); // FALSE ?> ]]> @@ -77,13 +77,13 @@ $a = array ('test' => 1, 'hello' => NULL); -var_dump( isset ($a['test']) ); // TRUE -var_dump( isset ($a['foo']) ); // FALSE -var_dump( isset ($a['hello']) ); // FALSE +var_dump(isset($a['test'])); // TRUE +var_dump(isset($a['foo'])); // FALSE +var_dump(isset($a['hello'])); // FALSE // La chiave 'hello' vale NULL pertanto viene considerata non impostata. // Se si desidera verificare l'esistenza di chiavi con valore NULL, usare: -var_dump( array_key_exists('hello', $a) ); // TRUE +var_dump(array_key_exists('hello', $a)); // TRUE ?> ]]> Index: phpdoc-it/reference/var/functions/print-r.xml diff -u phpdoc-it/reference/var/functions/print-r.xml:1.5 phpdoc-it/reference/var/functions/print-r.xml:1.6 --- phpdoc-it/reference/var/functions/print-r.xml:1.5 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/print-r.xml Fri Jan 9 15:30:29 2004 @@ -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.print-r"> <refnamediv> <refname>print_r</refname> @@ -79,7 +79,7 @@ <![CDATA[ <?php $b = array ('m' => 'monkey', 'foo' => 'bar', 'x' => array ('x', 'y', 'z')); - $results = print_r ($b, true); //$results ora contiene l'output di print_r + $results = print_r($b, true); //$results ora contiene l'output di print_r ?> ]]> </programlisting> Index: phpdoc-it/reference/var/functions/serialize.xml diff -u phpdoc-it/reference/var/functions/serialize.xml:1.5 phpdoc-it/reference/var/functions/serialize.xml:1.6 --- phpdoc-it/reference/var/functions/serialize.xml:1.5 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/serialize.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.6 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: darvina Status: ready --> <refentry id="function.serialize"> <refnamediv> <refname>serialize</refname> @@ -69,11 +69,11 @@ // per l'utente. Si userà serialize() per memorizzare le informazioni // all'interno di un database alla fine della richiesta.. -$conn = odbc_connect ("webdb", "php", "chicken"); -$stmt = odbc_prepare ($conn, +$conn = odbc_connect("webdb", "php", "chicken"); +$stmt = odbc_prepare($conn, "UPDATE sessions SET data = ? WHERE id = ?"); $sqldata = array (serialize($session_data), $PHP_AUTH_USER); -if (!odbc_execute ($stmt, &$sqldata)) { +if (!odbc_execute($stmt, &$sqldata)) { $stmt = odbc_prepare($conn, "INSERT INTO sessions (id, data) VALUES(?, ?)"); if (!odbc_execute($stmt, &$sqldata)) { Index: phpdoc-it/reference/var/functions/unserialize.xml diff -u phpdoc-it/reference/var/functions/unserialize.xml:1.7 phpdoc-it/reference/var/functions/unserialize.xml:1.8 --- phpdoc-it/reference/var/functions/unserialize.xml:1.7 Mon May 5 15:54:43 2003 +++ phpdoc-it/reference/var/functions/unserialize.xml Fri Jan 9 15:30:29 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/var.xml, last change in rev 1.16 --> <!-- last change to 'unserialize' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.12 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.13 Maintainer: darvina Status: ready --> <!-- OLD-Revision: 1.104/EN.1.2 --> <refentry id="function.unserialize"> <refnamediv> @@ -54,7 +54,7 @@ $serialized_object='O:1:"a":1:{s:5:"value";s:3:"100";}'; // direttiva unserialize_callback_func disponibile dalla versione 4.2.0 -ini_set('unserialize_callback_func','mycallback'); // imposta la funzione di callback +ini_set('unserialize_callback_func', 'mycallback'); // imposta la funzione di callback function mycallback($classname) { // semplicemente include un file contenente la definizione della classe @@ -85,16 +85,16 @@ // alla variabile $session_data. Questo esempio è complementare a quello illustrato // nella funzione <function>serialize</function>. -$conn = odbc_connect ("webdb", "php", "chicken"); -$stmt = odbc_prepare ($conn, "SELECT data FROM sessions WHERE id = ?"); +$conn = odbc_connect("webdb", "php", "chicken"); +$stmt = odbc_prepare($conn, "SELECT data FROM sessions WHERE id = ?"); $sqldata = array ($PHP_AUTH_USER); -if (!odbc_execute ($stmt, &$sqldata) || !odbc_fetch_into ($stmt, &$tmp)) { +if (!odbc_execute($stmt, &$sqldata) || !odbc_fetch_into($stmt, &$tmp)) { // se odbc_execute o odbc_fetch_into hanno un errore si predispone un array vuoto $session_data = array(); } else { // ora abbiamo i dati serializzati in $tmp[0]. - $session_data = unserialize ($tmp[0]); - if (!is_array ($session_data)) { + $session_data = unserialize($tmp[0]); + if (!is_array($session_data)) { // qualcosa è andato storto, si predispone un array vuoto $session_data = array(); } Index: phpdoc-it/reference/var/functions/unset.xml diff -u phpdoc-it/reference/var/functions/unset.xml:1.4 phpdoc-it/reference/var/functions/unset.xml:1.5 --- phpdoc-it/reference/var/functions/unset.xml:1.4 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/unset.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.6 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: darvina Status: ready --> <refentry id="function.unset"> <refnamediv> <refname>unset</refname> @@ -29,13 +29,13 @@ <![CDATA[ <?php // Distrugge una singola variabile -unset ($foo); +unset($foo); // distrugge un singolo elemento di un array -unset ($bar['quux']); +unset($bar['quux']); // distrugge più di una variabile -unset ($foo1, $foo2, $foo3); +unset($foo1, $foo2, $foo3); ?> ]]> </programlisting> Index: phpdoc-it/reference/var/functions/var-dump.xml diff -u phpdoc-it/reference/var/functions/var-dump.xml:1.4 phpdoc-it/reference/var/functions/var-dump.xml:1.5 --- phpdoc-it/reference/var/functions/var-dump.xml:1.4 Mon May 5 15:54:43 2003 +++ phpdoc-it/reference/var/functions/var-dump.xml Fri Jan 9 15:30:29 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/var.xml, last change in rev 1.16 --> <!-- last change to 'var-dump' in en/ tree in rev 1.84 --> -<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: darvina Status: ready --> <!-- OLD-Revision: 1.104/EN.1.84 --> <refentry id="function.var-dump"> <refnamediv> @@ -31,12 +31,18 @@ <title>Esempio di <function>var_dump</function></title> <programlisting role="php"> <![CDATA[ -<pre> + <?php $a = array (1, 2, array ("a", "b", "c")); -var_dump ($a); - -/* output: +var_dump($a); +?> +]]> + </programlisting> + <para> + Output: + </para> + <screen> +<![CDATA[ array(3) { [0]=> int(1) @@ -52,22 +58,26 @@ string(1) "c" } } - -*/ - +]]> + </screen> + <programlisting role="php"> +<![CDATA[ +<?php $b = 3.1; -$c = TRUE; -var_dump($b,$c); - -/* output: -float(3.1) -bool(true) - -*/ +$c = true; +var_dump($b, $c); ?> -</pre> ]]> </programlisting> + <para> + output: + </para> + <screen> +<![CDATA[ +float(3.1) +bool(true) +]]> + </screen> </example> </para> </refsect1> Index: phpdoc-it/reference/var/functions/var-export.xml diff -u phpdoc-it/reference/var/functions/var-export.xml:1.2 phpdoc-it/reference/var/functions/var-export.xml:1.3 --- phpdoc-it/reference/var/functions/var-export.xml:1.2 Wed Apr 17 03:08:53 2002 +++ phpdoc-it/reference/var/functions/var-export.xml Fri Jan 9 15:30:29 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/var.xml, last change in rev 1.1 --> <!-- last change to 'var-export' in en/ tree in rev 1.6 --> -<!-- EN-Revision: 1.2 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: darvina Status: ready --> <!-- OLD-Revision: 1.104/EN.1.6 --> <refentry id="function.var-export"> <refnamediv> @@ -32,12 +32,17 @@ <informalexample> <programlisting role="php"> <![CDATA[ -<pre> <?php $a = array (1, 2, array ("a", "b", "c")); -var_export ($a); - -/* output: +var_export($a); +?> +]]> + </programlisting> + <para> + output: + </para> + <screen> +<![CDATA[ array ( 0 => 1, 1 => 2, @@ -48,19 +53,25 @@ 2 => 'c', ), ) -*/ - +]]> + </screen> + <programlisting role="php"> +<![CDATA[ +<?php $b = 3.1; -$v = var_export($b, TRUE); +$v = var_export($b, true); echo $v; - -/* output: -3.1 -*/ ?> -</pre> ]]> </programlisting> + <para> + output: + </para> + <screen> +<![CDATA[ +3.1 +]]> + </screen> </informalexample> </para> </refsect1>
Index: phpdoc-it/reference/var/ini.xml diff -u phpdoc-it/reference/var/ini.xml:1.2 phpdoc-it/reference/var/ini.xml:1.3 --- phpdoc-it/reference/var/ini.xml:1.2 Mon May 5 15:54:17 2003 +++ phpdoc-it/reference/var/ini.xml Fri Jan 9 15:30:28 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: darvina Status: ready --> <section id="var.configuration"> &reftitle.runtime; &extension.runtime; Index: phpdoc-it/reference/var/functions/floatval.xml diff -u phpdoc-it/reference/var/functions/floatval.xml:1.3 phpdoc-it/reference/var/functions/floatval.xml:1.4 --- phpdoc-it/reference/var/functions/floatval.xml:1.3 Fri Jun 6 16:16:12 2003 +++ phpdoc-it/reference/var/functions/floatval.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> <refentry id="function.floatval"> <refnamediv> <refname>floatval</refname> @@ -22,8 +22,8 @@ <![CDATA[ <?php $var = '122.34343The'; -$valore_float_di_var = floatval ($var); -print $valore_float_di_var; // visualizza 122.34343 +$valore_float_di_var = floatval($var); +echo $valore_float_di_var; // visualizza 122.34343 ?> ]]> </programlisting> Index: phpdoc-it/reference/var/functions/get-defined-vars.xml diff -u phpdoc-it/reference/var/functions/get-defined-vars.xml:1.4 phpdoc-it/reference/var/functions/get-defined-vars.xml:1.5 --- phpdoc-it/reference/var/functions/get-defined-vars.xml:1.4 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/get-defined-vars.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.5 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: darvina Status: ready --> <refentry id="function.get-defined-vars"> <refnamediv> <refname>get_defined_vars</refname> @@ -23,7 +23,7 @@ <programlisting role="php"> <![CDATA[ <?php -$b = array(1,1,2,3,5,8); +$b = array(1, 1, 2, 3, 5, 8); $arr = get_defined_vars(); Index: phpdoc-it/reference/var/functions/get-resource-type.xml diff -u phpdoc-it/reference/var/functions/get-resource-type.xml:1.3 phpdoc-it/reference/var/functions/get-resource-type.xml:1.4 --- phpdoc-it/reference/var/functions/get-resource-type.xml:1.3 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/get-resource-type.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: darvina Status: ready --> <refentry id="function.get-resource-type"> <refnamediv> <refname>get_resource_type</refname> @@ -25,13 +25,13 @@ <![CDATA[ <?php $c = mysql_connect(); -echo get_resource_type($c)."\n"; +echo get_resource_type($c) . "\n"; // visualizza: file $fp = fopen("foo","w"); -echo get_resource_type($fp)."\n"; +echo get_resource_type($fp) . "\n"; // visualizza: domxml document $doc = new_xmldoc("1.0"); -echo get_resource_type($doc->doc)."\n"; +echo get_resource_type($doc->doc) . "\n"; ?> ]]> </programlisting> Index: phpdoc-it/reference/var/functions/gettype.xml diff -u phpdoc-it/reference/var/functions/gettype.xml:1.3 phpdoc-it/reference/var/functions/gettype.xml:1.4 --- phpdoc-it/reference/var/functions/gettype.xml:1.3 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/gettype.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> <refentry id="function.gettype"> <refnamediv> <refname>gettype</refname> Index: phpdoc-it/reference/var/functions/import-request-variables.xml diff -u phpdoc-it/reference/var/functions/import-request-variables.xml:1.5 phpdoc-it/reference/var/functions/import-request-variables.xml:1.6 --- phpdoc-it/reference/var/functions/import-request-variables.xml:1.5 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/import-request-variables.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.9 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.10 Maintainer: darvina Status: ready --> <refentry id="function.import-request-variables"> <refnamediv> <refname>import_request_variables</refname> @@ -60,7 +60,7 @@ // con il prefisso "rvar_" import_request_variables("gP", "rvar_"); -print $rvar_foo; +echo $rvar_foo; ?> ]]> </programlisting> Index: phpdoc-it/reference/var/functions/is-bool.xml diff -u phpdoc-it/reference/var/functions/is-bool.xml:1.3 phpdoc-it/reference/var/functions/is-bool.xml:1.4 --- phpdoc-it/reference/var/functions/is-bool.xml:1.3 Mon Feb 24 15:52:41 2003 +++ phpdoc-it/reference/var/functions/is-bool.xml Fri Jan 9 15:30:29 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/var.xml, last change in rev 1.4 --> <!-- last change to 'is-bool' in en/ tree in rev 1.19 --> -<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: darvina Status: ready --> <!-- OLD-Revision: 1.104/EN.1.19 --> <refentry id="function.is-bool"> <refnamediv> @@ -31,12 +31,12 @@ // Poichè $a è booleana, questa è vera if (is_bool($a)) { - print "Sì, è booleana"; + echo "Sì, è booleana"; } // Poichè $b non è booleana, questa non è vera if (is_bool($b)) { - print "Sì, è booleana"; + echo "Sì, è booleana"; } ?> ]]> Index: phpdoc-it/reference/var/functions/is-callable.xml diff -u phpdoc-it/reference/var/functions/is-callable.xml:1.4 phpdoc-it/reference/var/functions/is-callable.xml:1.5 --- phpdoc-it/reference/var/functions/is-callable.xml:1.4 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/is-callable.xml Fri Jan 9 15:30:29 2004 @@ -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.is-callable"> <refnamediv> <refname>is_callable</refname> @@ -41,7 +41,7 @@ il richiamo ad un metodo statico, questo non è il caso. </para> <informalexample> - <programlisting> + <programlisting role="php"> <![CDATA[ <?php // Come verificare se una variabile può essere eseguita @@ -56,7 +56,7 @@ $functionVariable = 'unaFunzione'; -var_dump( is_callable( $functionVariable, false, $callable_name )); // bool(true) +var_dump(is_callable( $functionVariable, false, $callable_name )); // bool(true) echo $callable_name, "\n"; // unaFunzione @@ -72,13 +72,9 @@ } $anObject = new unaClasse(); - -$methodVariable = array( $anObject, 'unMetodo' ); - -var_dump( is_callable( $methodVariable, true, $callable_name )); // bool(true) - +$methodVariable = array($anObject, 'unMetodo' ); +var_dump(is_callable($methodVariable, true, $callable_name )); // bool(true) echo $callable_name, "\n"; // unaClasse:unMetodo - ?> ]]> </programlisting> Index: phpdoc-it/reference/var/functions/is-resource.xml diff -u phpdoc-it/reference/var/functions/is-resource.xml:1.2 phpdoc-it/reference/var/functions/is-resource.xml:1.3 --- phpdoc-it/reference/var/functions/is-resource.xml:1.2 Wed Apr 17 03:08:52 2002 +++ phpdoc-it/reference/var/functions/is-resource.xml Fri Jan 9 15:30:29 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/var.xml, last change in rev 1.16 --> <!-- last change to 'is-resource' in en/ tree in rev 1.19 --> -<!-- EN-Revision: 1.2 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: darvina Status: ready --> <!-- OLD-Revision: 1.104/EN.1.19 --> <refentry id="function.is-resource"> <refnamediv> @@ -22,6 +22,22 @@ altrimenti restituisce &false;. </para> <para> + <example> + <title>Utilizzo di <function>is_resource</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +$db_link = @mysql_connect('localhost', 'mysql_user', 'mysql_pass'); +if (!is_resource($db_link)) { + die('Can\'t connect : ' . mysql_error()); +} +?> +]]> + </programlisting> + </example> + </para> + <para> Per maggiori dettagli fare riferimento alla documentazione di <type>resource</type>-type </para> Index: phpdoc-it/reference/var/functions/is-scalar.xml diff -u phpdoc-it/reference/var/functions/is-scalar.xml:1.3 phpdoc-it/reference/var/functions/is-scalar.xml:1.4 --- phpdoc-it/reference/var/functions/is-scalar.xml:1.3 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/is-scalar.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> <refentry id="function.is-scalar"> <refnamediv> <refname>is_scalar</refname> Index: phpdoc-it/reference/var/functions/isset.xml diff -u phpdoc-it/reference/var/functions/isset.xml:1.6 phpdoc-it/reference/var/functions/isset.xml:1.7 --- phpdoc-it/reference/var/functions/isset.xml:1.6 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/isset.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.11 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.12 Maintainer: darvina Status: ready --> <refentry id="function.isset"> <refnamediv> <refname>isset</refname> @@ -43,7 +43,7 @@ // Questo test sarà &true; pertanto sarà visualizzato il testo. if (isset($var)) { - print "Questa variabile è valorizzata, pertanto scrivo."; + echo "Questa variabile è valorizzata, pertanto scrivo."; } // Nel prossimo esempio useremo var_dump per visualizzare @@ -52,16 +52,16 @@ $a = "test"; $b = "anothertest"; -var_dump( isset($a) ); // TRUE -var_dump( isset ($a, $b) ); // TRUE +var_dump(isset($a)); // TRUE +var_dump(isset($a, $b)); // TRUE unset ($a); -var_dump( isset ($a) ); // FALSE -var_dump( isset ($a, $b) ); // FALSE +var_dump(isset($a)); // FALSE +var_dump(isset($a, $b)); // FALSE $foo = NULL; -var_dump( isset ($foo) ); // FALSE +var_dump(isset($foo)); // FALSE ?> ]]> @@ -77,13 +77,13 @@ $a = array ('test' => 1, 'hello' => NULL); -var_dump( isset ($a['test']) ); // TRUE -var_dump( isset ($a['foo']) ); // FALSE -var_dump( isset ($a['hello']) ); // FALSE +var_dump(isset($a['test'])); // TRUE +var_dump(isset($a['foo'])); // FALSE +var_dump(isset($a['hello'])); // FALSE // La chiave 'hello' vale NULL pertanto viene considerata non impostata. // Se si desidera verificare l'esistenza di chiavi con valore NULL, usare: -var_dump( array_key_exists('hello', $a) ); // TRUE +var_dump(array_key_exists('hello', $a)); // TRUE ?> ]]> Index: phpdoc-it/reference/var/functions/print-r.xml diff -u phpdoc-it/reference/var/functions/print-r.xml:1.5 phpdoc-it/reference/var/functions/print-r.xml:1.6 --- phpdoc-it/reference/var/functions/print-r.xml:1.5 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/print-r.xml Fri Jan 9 15:30:29 2004 @@ -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.print-r"> <refnamediv> <refname>print_r</refname> @@ -79,7 +79,7 @@ <![CDATA[ <?php $b = array ('m' => 'monkey', 'foo' => 'bar', 'x' => array ('x', 'y', 'z')); - $results = print_r ($b, true); //$results ora contiene l'output di print_r + $results = print_r($b, true); //$results ora contiene l'output di print_r ?> ]]> </programlisting> Index: phpdoc-it/reference/var/functions/serialize.xml diff -u phpdoc-it/reference/var/functions/serialize.xml:1.5 phpdoc-it/reference/var/functions/serialize.xml:1.6 --- phpdoc-it/reference/var/functions/serialize.xml:1.5 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/serialize.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.6 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: darvina Status: ready --> <refentry id="function.serialize"> <refnamediv> <refname>serialize</refname> @@ -69,11 +69,11 @@ // per l'utente. Si userà serialize() per memorizzare le informazioni // all'interno di un database alla fine della richiesta.. -$conn = odbc_connect ("webdb", "php", "chicken"); -$stmt = odbc_prepare ($conn, +$conn = odbc_connect("webdb", "php", "chicken"); +$stmt = odbc_prepare($conn, "UPDATE sessions SET data = ? WHERE id = ?"); $sqldata = array (serialize($session_data), $PHP_AUTH_USER); -if (!odbc_execute ($stmt, &$sqldata)) { +if (!odbc_execute($stmt, &$sqldata)) { $stmt = odbc_prepare($conn, "INSERT INTO sessions (id, data) VALUES(?, ?)"); if (!odbc_execute($stmt, &$sqldata)) { Index: phpdoc-it/reference/var/functions/unserialize.xml diff -u phpdoc-it/reference/var/functions/unserialize.xml:1.7 phpdoc-it/reference/var/functions/unserialize.xml:1.8 --- phpdoc-it/reference/var/functions/unserialize.xml:1.7 Mon May 5 15:54:43 2003 +++ phpdoc-it/reference/var/functions/unserialize.xml Fri Jan 9 15:30:29 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/var.xml, last change in rev 1.16 --> <!-- last change to 'unserialize' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.12 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.13 Maintainer: darvina Status: ready --> <!-- OLD-Revision: 1.104/EN.1.2 --> <refentry id="function.unserialize"> <refnamediv> @@ -54,7 +54,7 @@ $serialized_object='O:1:"a":1:{s:5:"value";s:3:"100";}'; // direttiva unserialize_callback_func disponibile dalla versione 4.2.0 -ini_set('unserialize_callback_func','mycallback'); // imposta la funzione di callback +ini_set('unserialize_callback_func', 'mycallback'); // imposta la funzione di callback function mycallback($classname) { // semplicemente include un file contenente la definizione della classe @@ -85,16 +85,16 @@ // alla variabile $session_data. Questo esempio è complementare a quello illustrato // nella funzione <function>serialize</function>. -$conn = odbc_connect ("webdb", "php", "chicken"); -$stmt = odbc_prepare ($conn, "SELECT data FROM sessions WHERE id = ?"); +$conn = odbc_connect("webdb", "php", "chicken"); +$stmt = odbc_prepare($conn, "SELECT data FROM sessions WHERE id = ?"); $sqldata = array ($PHP_AUTH_USER); -if (!odbc_execute ($stmt, &$sqldata) || !odbc_fetch_into ($stmt, &$tmp)) { +if (!odbc_execute($stmt, &$sqldata) || !odbc_fetch_into($stmt, &$tmp)) { // se odbc_execute o odbc_fetch_into hanno un errore si predispone un array vuoto $session_data = array(); } else { // ora abbiamo i dati serializzati in $tmp[0]. - $session_data = unserialize ($tmp[0]); - if (!is_array ($session_data)) { + $session_data = unserialize($tmp[0]); + if (!is_array($session_data)) { // qualcosa è andato storto, si predispone un array vuoto $session_data = array(); } Index: phpdoc-it/reference/var/functions/unset.xml diff -u phpdoc-it/reference/var/functions/unset.xml:1.4 phpdoc-it/reference/var/functions/unset.xml:1.5 --- phpdoc-it/reference/var/functions/unset.xml:1.4 Fri Oct 3 15:27:49 2003 +++ phpdoc-it/reference/var/functions/unset.xml Fri Jan 9 15:30:29 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.6 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: darvina Status: ready --> <refentry id="function.unset"> <refnamediv> <refname>unset</refname> @@ -29,13 +29,13 @@ <![CDATA[ <?php // Distrugge una singola variabile -unset ($foo); +unset($foo); // distrugge un singolo elemento di un array -unset ($bar['quux']); +unset($bar['quux']); // distrugge più di una variabile -unset ($foo1, $foo2, $foo3); +unset($foo1, $foo2, $foo3); ?> ]]> </programlisting> Index: phpdoc-it/reference/var/functions/var-dump.xml diff -u phpdoc-it/reference/var/functions/var-dump.xml:1.4 phpdoc-it/reference/var/functions/var-dump.xml:1.5 --- phpdoc-it/reference/var/functions/var-dump.xml:1.4 Mon May 5 15:54:43 2003 +++ phpdoc-it/reference/var/functions/var-dump.xml Fri Jan 9 15:30:29 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/var.xml, last change in rev 1.16 --> <!-- last change to 'var-dump' in en/ tree in rev 1.84 --> -<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: darvina Status: ready --> <!-- OLD-Revision: 1.104/EN.1.84 --> <refentry id="function.var-dump"> <refnamediv> @@ -31,12 +31,18 @@ <title>Esempio di <function>var_dump</function></title> <programlisting role="php"> <![CDATA[ -<pre> + <?php $a = array (1, 2, array ("a", "b", "c")); -var_dump ($a); - -/* output: +var_dump($a); +?> +]]> + </programlisting> + <para> + Output: + </para> + <screen> +<![CDATA[ array(3) { [0]=> int(1) @@ -52,22 +58,26 @@ string(1) "c" } } - -*/ - +]]> + </screen> + <programlisting role="php"> +<![CDATA[ +<?php $b = 3.1; -$c = TRUE; -var_dump($b,$c); - -/* output: -float(3.1) -bool(true) - -*/ +$c = true; +var_dump($b, $c); ?> -</pre> ]]> </programlisting> + <para> + output: + </para> + <screen> +<![CDATA[ +float(3.1) +bool(true) +]]> + </screen> </example> </para> </refsect1> Index: phpdoc-it/reference/var/functions/var-export.xml diff -u phpdoc-it/reference/var/functions/var-export.xml:1.2 phpdoc-it/reference/var/functions/var-export.xml:1.3 --- phpdoc-it/reference/var/functions/var-export.xml:1.2 Wed Apr 17 03:08:53 2002 +++ phpdoc-it/reference/var/functions/var-export.xml Fri Jan 9 15:30:29 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/var.xml, last change in rev 1.1 --> <!-- last change to 'var-export' in en/ tree in rev 1.6 --> -<!-- EN-Revision: 1.2 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: darvina Status: ready --> <!-- OLD-Revision: 1.104/EN.1.6 --> <refentry id="function.var-export"> <refnamediv> @@ -32,12 +32,17 @@ <informalexample> <programlisting role="php"> <![CDATA[ -<pre> <?php $a = array (1, 2, array ("a", "b", "c")); -var_export ($a); - -/* output: +var_export($a); +?> +]]> + </programlisting> + <para> + output: + </para> + <screen> +<![CDATA[ array ( 0 => 1, 1 => 2, @@ -48,19 +53,25 @@ 2 => 'c', ), ) -*/ - +]]> + </screen> + <programlisting role="php"> +<![CDATA[ +<?php $b = 3.1; -$v = var_export($b, TRUE); +$v = var_export($b, true); echo $v; - -/* output: -3.1 -*/ ?> -</pre> ]]> </programlisting> + <para> + output: + </para> + <screen> +<![CDATA[ +3.1 +]]> + </screen> </informalexample> </para> </refsect1>