如何使用 GET 参数遍历所有短语并将它们作为链接列表输出?
如何创建一个数组,用整数索引,然后使用 GET 变量来选择这些短语之一。
到目前为止我的代码;
$arr = array('1' => 'Que será, será.', '2' => 'C’est la vie!', '3' => 'Sich nicht um ungelegte Eier kümmern.', '4' => 'Ada asap, ada api.', '5' => 'Batti il ferro finché è caldo.');
?>
<p><?php print $arr[1]; ?> - Whatever will be, will be.</p>
<p><?php print $arr[2]; ?> – That’s the life.</p>
<p><?php print $arr[3]; ?> - Don’t count your chickens before they hatch.</p>
<p><?php print $arr[4]; ?> - There's no smoke without fire.</p>
<p><?php print $arr[5]; ?> - Strike while the iron is hot.</p>