PHP Simple Tutorial - 考前複習神器

<?php ?>
<?php$arr = array("a"=>"dabc","b"=>"dcba","c"=>"dcab","d"=>"abcd");$cr_ans = "c";print_r($arr);?>
foreach($arr as $key => $value){echo "$key: $value";}
foreach($arr as $key => $value){echo "<input type=\"radio\" value=\"$key\"><label>$key: $value</label>";}
  1. Having the same name groups a set of radio buttons into a single radio group
  2. The name is used to generate the form data to be submitted to the server
echo "<input type=\"radio\" id=\"$key\" name=\"ans\" value=\"$key\"><label for=\"$key\">$key: $value</label>";
<ul class="actions"> <li><input type="submit" value="送出">&nbsp;&nbsp;&nbsp;  <div style="float:right;">  <p style="color:green;">答對了!</p>  </div>  </li></ul>
<p style="color:green;">答對了!</p><p style="color:red;">答錯了!</p>

--

--

--

NTUT CSIE | Biomedical Informatics Lab | github.com/stwater20 | sectools.tw

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
ryan.chen

ryan.chen

NTUT CSIE | Biomedical Informatics Lab | github.com/stwater20 | sectools.tw

More from Medium

A Bit About PHP

Finding Function — PHP

Top 10 PHP Hosting Providers in 2022