Skip to content

Instantly share code, notes, and snippets.

@albertaparicio
Last active February 15, 2018 02:15
Show Gist options
  • Save albertaparicio/fb23eb5fa98f689ef8bde4f25dce6e7c to your computer and use it in GitHub Desktop.
Save albertaparicio/fb23eb5fa98f689ef8bde4f25dce6e7c to your computer and use it in GitHub Desktop.
PHP Wide text generator
<?php
/*
* Copyright 2016 Albert Aparicio
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
$text = $argv[1];
$normal = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', '0', '1
', '2', '3', '4', '5', '6', '7', '8', '9', '!', '#', '$', '%', '&', '\'', '(', ')', '*', '+', '-', '.', ',', '/', ':', ';', '<', '>', '@', '=', '?', '[', ']', '{', '}', '~', '|', '_');
$changed = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "\x20", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "!", "#", "$", "%", "&", "'", "(", ")", "*", "+", "-", ".", ",", "/", ":", ";", "<", ">", "@", "=", "?", "[", "]", "{", "}", "~", "|", "_");
echo str_replace($normal, $changed, $text) . PHP_EOL;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment