Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Loop through an associative array
SUBMITTED BY:
henry1874w
DATE:
June 17, 2017, 1:09 p.m.
FORMAT:
Text only
SIZE:
225 Bytes
Raw
Download
Tweet
HITS:
227
Go to comments
Report
<!DOCTYPE html>
<html>
<body>
<?php
$age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
foreach($age as $x => $x_value) {
echo "Key=" . $x . ", Value=" . $x_value;
echo "<br>";
}
?>
</body>
</html>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus