include_once sys inc start php include_once sys inc compress php inclu

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';
include_once 'sys/inc/thead.php';
aut();
mb_internal_encoding('utf-8');
header("Content-type: text/html; charset=utf8");
$text = isset($_POST['text']) ? htmlspecialchars($_POST['text']) : 0;
echo '<div class="view_ban">';
if ($_POST) {
function utf8_ucfirst($str)
{
preg_match_all("~^(.)(.*)$~u", $str, $arr);
return mb_strtoupper($arr[1][0]) . $arr[2][0];
}
function makeYodaStyleText($text)
{
$out = preg_split("/(\.|!|\?)[\s]/", $text);
for ($i = 0; $i < count($out); $i++) {
$words[$i] = explode(' ', $out[$i]);
$words[$i] = array_reverse($words[$i]);
$words[$i] = preg_replace('/(\.|!|\?|,)/i', null, $words[$i]);
$out[$i] = implode(' ', $words[$i]);
$out[$i] = utf8_ucfirst($out[$i]);
}
$out = implode('. ', $out);
return $out;
}
echo 'Результат:<b> ';
echo makeYodaStyleText(mb_strtolower($text));
echo '</b><br />';
echo 'Скопировать: <input type="text" name="copytext" value="'.makeYodaStyleText(mb_strtolower($text)).'" />
';
}
echo '<br/><br/>
<form action="" method="POST">
Введите текст:<br />
<input type="text" name="text" value="" /> <input type="submit" value="Go!" />
</form></div>
';
foots();
?>