Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Count the array recursively:
SUBMITTED BY:
henry1874w
DATE:
June 26, 2017, 5:11 p.m.
FORMAT:
Text only
SIZE:
265 Bytes
Raw
Download
Tweet
HITS:
293
Go to comments
Report
<?php
$cars=array
(
"Volvo"=>array
(
"XC60",
"XC90"
),
"BMW"=>array
(
"X3",
"X5"
),
"Toyota"=>array
(
"Highlander"
)
);
echo "Normal count: " . count($cars)."<br>";
echo "Recursive count: " . count($cars,1);
?>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus