- Forums
- PHP
- How To Get Array Values Using Foreach Loop In Arrays
This Page Contains information about How To Get Array Values Using Foreach Loop In Arrays By wallpaperama in category PHP with 0 Replies. [1271], Last Updated: Sat May 18, 2024
wallpaperama
Sun Apr 12, 2009
0 Comments
783 Visits
sometimes when you are newbie to php, it gets complicated when you come up with arrays and you try to figure out how to get the value of an element, well, hopefully you can use this post here as i learned this today
<?php
// fill in some information
$userinfo["Name"] = "John Doe";
$userinfo["Location"] = "San Francisco";
$userinfo["Occupation"] = "Programmer";
foreach($userinfo as $key=>$value) {
print("$key is $value.<br>");
}
?>