示例#1
0
<?php

//
// $Id: test.php 2055 2009-11-06 23:09:58Z shodan $
//
require "util/top_foot_inc.php";
top3();
// require ( "funzioni.php" );
require_once "util/mysqlutil.php";
connetti();
?>
<li><strong>sticky, with arrows</strong>:This sticky clueTip has its "close"
 text in the title bar. It won't close until you close it, or until you hover
  over another clue-tipped link. It also displays an arrow on one of its sides, 
pointing to the invoking element. 




<a
	rel="l2.php?l=1"
	href="l2.php"
	id="sticky"
	title=""
	style=""
	class="jtip"
>sticky clueTip with arrows</a></li>
 	<a
	rel="l2.php?l=0"
	href="l2.php?l=0"
	id="sticky"
示例#2
0
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
    <form action="2.php" method="post">
        <textarea name="words" id="words"></textarea><label for="words">Введите текст</label>
        <br>
        <input type="submit" value="Отправить" name="submit">
    </form>
    </body>
    </html>

<?php 
function top3($a)
{
    $a = preg_split("/[\\s,]+/", $a);
    sort($a);
    if (!empty($a)) {
        echo "ТОП 3 слова :<br>";
        for ($i = 2; $i >= 0; $i--) {
            if (isset($a[$i])) {
                echo $i + 1 . ") {$a[$i]}<br>";
            }
        }
    }
}
if (!empty($_POST['words'])) {
    top3($_POST['words']);
} else {
    echo "Вы не ввели слова";
}