★ wanayoo — archive 1999 http://www.php.net/manual/it/function.print-r.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Variabili
Quick Reference
English version of this pageGerman version of this pageJapanese version of this pageFrench version of this pageHungarian version of this page
Variabili
* call_user_func
* call_user_method
* doubleval
* empty
* gettype
* intval
* is_array
* is_bool
* is_double
* is_float
* is_int
* is_integer
* is_long
* is_numeric
* is_object
* is_real
* is_resource
* is_string
* isset
* print_r
* settype
* strval
* unset
* var_dump
Manual: print_r
View the source code for this pageSearch the site



Previous page
 isset
 Updated
Sun, 06 Aug 2000
settype 
Next page


print_r

(PHP4 )

print_r --  Stampa informazioni relative al contenuto di una variabile in formato leggibile

Descrizione

void print_r (mixed expression)

Questa funzione stampa delle informazioni sul contenuto di una variabile in un formato facilmente leggibile. Se la variabile contiene una stringa, un intero o un numero decimale, il valore stesso viene visualizzato. Se la variabile contiene un vettore (array) i valori vengono visualizzati in un formato che evidenzia le chiavi ed i relativi elementi. Una notazione simile viene utilizzata per gli oggetti.

Si confronti print_r() e var_dump().


<?php
$a = array (1, 2, array ("a", "b", "c"));
print_r ($a);
?>
      

Attenzione

Questa funzione continua all'infinito se riceve come parametro un vettore o un oggetto contenente una referenza diretta o indiretta a se stesso oppure contenente ulteriori vettori o oggetti che a loro volta referenziano il padre o se stessi. Un caso evidente è print_r($GLOBALS), in quanto $GLOBALS è a sua volta una variabile globale e in quanto tale contiene una referenza a se stessa.


User Contributed Notes: print_r


zak@freeimages.com
03-May-2000 05:09
If you use var_dump or print_r on an array, then the function will move the array pointer to the end of the array.

Use the reset function to return the pointer to the beginning of the array.



 About Notes


Previous page
 isset
 Updated
Sun, 06 Aug 2000
settype 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.