s426086-testrepo/index.php
2020-05-06 18:09:12 +00:00

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>