Init
This commit is contained in:
		
							
								
								
									
										8
									
								
								characters.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								characters.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| { | ||||
|     "A": "4", | ||||
|     "E": "3", | ||||
|     "I": "1", | ||||
|     "O": "0", | ||||
|     "S": "5", | ||||
|     "T": "7" | ||||
| } | ||||
							
								
								
									
										59
									
								
								index.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								index.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,59 @@ | ||||
| <?php | ||||
|  | ||||
| $characters = file_get_contents(__DIR__."/characters.json"); | ||||
| $characters = json_decode($characters); | ||||
|  | ||||
| echo " | ||||
| =============== WiseText Generator =============== | ||||
| "; | ||||
|  | ||||
| echo "\n\n"; | ||||
|  | ||||
| $stdin = fopen('php://stdin', 'r'); | ||||
|  | ||||
| echo "Select Mode: "."\n"; | ||||
| echo "1: Normal Text to Wise Text "."\n"; | ||||
| echo "2: Wise Text to Normal Text "."\n"; | ||||
| $input = trim(fgets($stdin)); | ||||
| echo "\n"."\n"; | ||||
|  | ||||
| if(isset($input) && $input != '' && $input == '1'){ | ||||
|     echo "Insert text: "."\n"; | ||||
|     $input = trim(fgets($stdin)); | ||||
|  | ||||
|     if(isset($input) && $input != ''){ | ||||
|         $input = mb_strtoupper($input); | ||||
|  | ||||
|         foreach($characters as $key => $value){ | ||||
|             $input = str_replace($key, $value, $input); | ||||
|         } | ||||
|  | ||||
|         echo "\n"."\n"; | ||||
|  | ||||
|         echo "Answer: "."\n"; | ||||
|         echo "$input"."\n"."\n"; | ||||
|     } | ||||
| } | ||||
|  | ||||
| if(isset($input) && $input != '' && $input == '2'){ | ||||
|     echo "Insert text: "."\n"; | ||||
|     $input = trim(fgets($stdin)); | ||||
|  | ||||
|     if(isset($input) && $input != ''){ | ||||
|  | ||||
|         $input = mb_strtoupper($input); | ||||
|  | ||||
|         foreach($characters as $key => $value){ | ||||
|             $input = str_replace($value, $key, $input); | ||||
|         } | ||||
|  | ||||
|         echo "\n"."\n"; | ||||
|  | ||||
|         echo "Answer: "."\n"; | ||||
|         echo "$input"."\n"."\n"; | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| ?> | ||||
		Reference in New Issue
	
	Block a user
	 Christer Warén
					Christer Warén