《艾爾登法環》女武神招式拆解與盾反心得
阿新 • • 發佈:2022-03-22
今天學習了一天的php和matlab
用php語言實現了html和php語言的互動
程式碼部分如下
<?php $values=''; if(!empty($_POST)) { $num = $_POST['num']; $zhuanhuan = $_POST['zhuanhuan']; if($zhuanhuan == 2) { $values = decbin($num); } else if($zhuanhuan == 8) { $values = decoct($num); }else { $values = dechex($num); } } ?> <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>轉換進位制</title> </head> <body> <form action="php-7.php" method="post"> 十進位制:<input type="text" name="num"> 請輸入要轉換的進位制:<select name="zhuanhuan" id=""> <option value="2">二進位制</option> <option value="8">八進位制</option> <option value="16">十六進位制</option> </select><input type="submit" value="轉換"> <input type="text" name="" id="" value="<?php echo $values;?>"><br> </form> </body> </html>
可以實現十進位制轉換成二進位制,八進位制,十六進位制的頁面