1. Computing & Technology

Discuss in my forum

Print_r () PHP Function

By , About.com Guide

See More About:
Definition: The Print_r () PHP function is used to return an array in a human readable form. It is simply written as Print_r ($your_array)
Also Known As: Print Array
Examples:
<?php
 $Names = array ('a' => 'Angela', 'b' => 'Bradley', 'c' => array ('Cade', 'Caleb')); 
 print_r ($Names);
 ?>
The results would be something like:

Array
(
[a] => Angela
[b] => Bradley
[c] => Array
     (
     [0] => Cade
     [1] => Caleb
     )
)

©2012 About.com. All rights reserved.

A part of The New York Times Company.