Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Functions */
- function addspaces(&$string){
- $string = implode(' ', str_split($string));
- }
- function reverse(&$string){
- $string = strrev($string);
- }
- function setlower(&$string){
- $string = strtolower($string);
- }
- function setupper(&$string){
- $string = strtoupper($string);
- }
- /* Main script */
- $str = $_GET['merkkijono'];
- switch($_GET['mode']){
- case 1:
- addspaces($str);
- setlower($str);
- break;
- case 2:
- addspaces($str);
- setupper($str);
- break;
- case 3:
- reverse($str);
- setlower($str);
- break;
- case 4:
- reverse($str);
- setupper($str);
- break;
- }
- echo $str;
- ?>
Add Comment
Please, Sign In to add comment