Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $string = $_GET["string"];
- $stringLength = strlen($string);
- ?>
- <html>
- <head>
- <title>Feladat 2 - Szóközök száma</title>
- </head>
- <body>
- Beírt szöveg hossza : <br>
- <?php
- $space = 0;
- for($key = 0; $key <= ($stringLength - 1); $key++)
- {
- echo $string[$key] . "<br>";
- if($string[$key] == " ")
- {
- $space++;
- }
- }
- ?>
- Space-ek száma: <?php echo $space; ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement