Last active
August 29, 2015 14:22
-
-
Save haskellcamargo/1ae86fbf0b854158bf01 to your computer and use it in GitHub Desktop.
HOLY SHIT DON'T USE THIS WORKAROUND
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * @package unilsc | |
| * @author Marcelo Camargo | |
| * @since 2015/06/08 | |
| * @license GNU GPL v3 | |
| * P.S.: NMTBR => Not Meant To Be Readable. | |
| */ | |
| ini_set('display_startup_errors',1); | |
| ini_set('display_errors',1); | |
| error_reporting(-1); | |
| function unilsc($source) { | |
| $replacement_table = [ | |
| "→" => "->" | |
| ]; | |
| list ($primary, $secondary) = [[], []]; | |
| foreach ($replacement_table as $key => $value) { | |
| $primary[] = $key; | |
| $secondary[] = $value; | |
| } | |
| return str_replace($primary, $secondary, $source); | |
| } | |
| try { | |
| # unilsc file_name output_to get_from | |
| $file = $argv[1]; | |
| if (file_exists($file)) { | |
| echo unilsc(file_get_contents($file)); | |
| } else { | |
| throw new Exception("Fatal error: file unacessible\n"); | |
| } | |
| } catch (Exception $e) { | |
| echo $e->getMessage(); | |
| exit; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment