The Zepp "Zeppelin" Code started out as a simple algorithm to switch between strings and symbols. Each symbol would have a string associated with it, as well as a "Zepp Code" counter part using the following syntax "%000#" (minus quotations, of course).
Band Name: Scruffy & The Janitors
That '&' is not only ugly in the URL, but it's also reserved! So are #, %, =, etc.
To fix this, use ZeppCode!
ZeppCode uses three-way conversion that takes the first parameter and converts it to the second.
The code allows for urls like this example.com/band/scruffyAndTheJanitors instead of this:
example.com/index.php?band=Scruffy%20%26%20the%20Janitors
String: and
Zepp: %001#
Symbol: &
Initiation of the class is straight forward:
# CONFIGURATION OR FILE FOR USErequire_once("path/to/file/zeppTranslate.php"); $zepp = new zeppTranslate;
File being used for the database:
# CHANCES ARE THE MODEL FILE$urlSegment = "scruffyAndTheJanitors"; // If included in function, either call it new, or don't forget GLOBAL $var = $zepp->zeppCode("string", "zepp", $urlSegment); $sql = "SELECT `col` FROM `table` WHERE `col` = '$urlSegment' OR `col` = '$var'"; // SQL Process...
After retrieving item from Database:
# POSSIBLY THE VIEW, BUT CAN BE MODEL STILL$name = $zepp->zeppCode("zepp", "symbol", $databaseElement);