PHP/Utility Function/print r — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 10:37, 26 мая 2010
Examining an Array with print_r()
<html>
<head>
<title>Testing the print_r() Function</title>
</head>
<body>
<div>
<?php
$characters = array (
array (
"name"=> "bob",
"occupation" => "A",
),
array (
"name" => "sally",
"occupation" => "B",
)
);
print_r( $characters);
?>
</div>
</body>
</html>
print_r(,true ) passes its output back as its return value, and not print anything out.
<?
$myarray = array("Apples", "Oranges", "Pears");
$size = count($myarray);
$output = print_r($myarray, true);
print $output;
?>