Commit | Line | Data |
---|---|---|
8de51304 H |
1 | <?php\r |
2 | \r | |
3 | //die(urldecode("http://www.aliveband.se/L%e5tar/07-HARD%20DAYS%20NIGHT.mp3"));\r | |
4 | \r | |
5 | $str = "Lo";\r | |
6 | \r | |
7 | \r | |
8 | ///CODE//////////////////\r | |
9 | function str2lower($str) {\r | |
10 | return strtolower($str);\r | |
11 | }\r | |
12 | function str2upper($str) {\r | |
13 | return strtoupper($str);\r | |
14 | }\r | |
15 | \r | |
16 | function fill_notset($str, $len, $char) {\r | |
17 | $strout = $str;\r | |
18 | $start = strlen($strout);\r | |
19 | for($i=$start;$i<$len;$i++) {\r | |
20 | $strout[$i] = $char;\r | |
21 | }\r | |
22 | return($strout);\r | |
23 | }\r | |
24 | //echo(fill_notset("aa", 5, "b")); die();\r | |
25 | /////////////////////////\r | |
26 | $origstr = $str = str2lower($str);\r | |
27 | $len = strlen($str);\r | |
28 | $origlen = $len;\r | |
29 | \r | |
30 | $mask = "";\r | |
31 | for (;$len > 0;$len--) {\r | |
32 | $mask = $mask."1";\r | |
33 | } //echo($mask);\r | |
34 | \r | |
35 | $i = base_convert($mask, 2, 10); //echo($i);\r | |
36 | while(1) {\r | |
37 | $mask = base_convert($i, 10, 2);\r | |
38 | $mask = fill_notset($mask, $len, "b");\r | |
39 | if(strlen($mask) > strlen($str) || $i < 0) { die(); }\r | |
40 | \r | |
41 | //Regular\r | |
42 | $str = $origstr;\r | |
43 | for ($len = $origlen-1;$len>=0;$len--) {\r | |
44 | if(isset($mask[$len]) && $mask[$len] == "1") {\r | |
45 | $str[$len] = str2upper($str[$len]);\r | |
46 | }\r | |
47 | } echo($mask);\r | |
48 | echo("$str\n");\r | |
49 | \r | |
50 | /*/Reversed\r | |
51 | $mask = str_replace(array("0","1"), array("1","0"), $mask);\r | |
52 | $str = $origstr;\r | |
53 | for ($len = $origlen-1;$len>=0;$len--) {\r | |
54 | if(isset($mask[$len]) && $mask[$len] == "1") {\r | |
55 | $str[$len] = str2upper($str[$len]);\r | |
56 | }\r | |
57 | } //echo($mask);\r | |
58 | echo("$str\n");\r | |
59 | */\r | |
60 | \r | |
61 | $i--;\r | |
62 | }\r |