{
"USA":[{"country":"Albuquerque (ABQ)"},
{"country":"Allentown (ABE)"}
],
"Canada":{"country":"Calgary (YYC)"},
"Hawaii":{"country":"Honolulu International Apt (HNL)"}
}
Run Code Online (Sandbox Code Playgroud)
这是我的对象,我需要循环它,以便我可以获得像这样的所有值
美国
卡纳德
<?php
require('config.php');
if(isset($_POST['submit'])){
}else{
$form =<<<EOT
<form action="reg.php" method="POST">
First Name: <input type="text" name="name"/><br />
Last Name: <input type="text" name="lname"/><br />
Username: <input type="text" name="uname"/><br />
Email: <input type="text" name="email1"/><br />
Confirm Email: <input type="text" name="email2"/><br />
Password: <input type="password" name="pass1"/><br />
Confirm Password: <input type="password" name="pass2"/><br />
<input type="submit" value="Register" name="submit"/>
</form>
EOT;
echo $form;
}
?>
Run Code Online (Sandbox Code Playgroud)