20 lines
427 B
PHP
20 lines
427 B
PHP
<html>
|
|
<body>
|
|
<?php if (! isset($_POST['text'])) {
|
|
echo '
|
|
<form action="/" method="post">
|
|
Tekst: <textarea name="text"></textarea>
|
|
<input type="submit">
|
|
</form>';
|
|
} else {
|
|
$text = $_POST['text'];
|
|
echo '<h4>Liczba wielkich liter</h4>';
|
|
echo strlen(preg_replace('![^a-z]+!', '', $text));
|
|
echo '<h4>Liczba małych liter</h4>';
|
|
echo strlen(preg_replace('![^A-Z]+!', '', $text));
|
|
;
|
|
}
|
|
?>
|
|
|
|
</body>
|
|
</html>
|