1
0
Fork 0
php-coding/7.work4.php

32 lines
719 B
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>数组升序排序</title>
</head>
<body>
<form action="#" method="post">
<table>
<tr>
<td>
<label for="input1">需要排序的数组(使用,隔开):</label>
</td>
<td>
<textarea name="input" id="input1"></textarea>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center">
<input type="submit" value="提交">
</td>
</tr>
</table>
</form>
<?php
if (isset($_POST['input'])){
$inputs = explode(',',trim($_POST['input']));
sort($inputs);
print_r($inputs);
}
?>
</body>