Skip to content

Instantly share code, notes, and snippets.

View pentagonal's full-sized avatar

Pentagonal pentagonal

View GitHub Profile
@pentagonal
pentagonal / Slim-3-Rewrite-MiddleWare.php
Last active June 24, 2016 13:10
Slim 3 Framework to Handle Duplicate Route Request by file access
<?php
/**
* Add MiddleWare to fix URL Rewrites
* Prevent Duplicate Route Access for
* ^/indexfile.php/main === ^/main
* Slim variable is from context object of
* -----------------------------------
* $slim = new \Slim\App();
* -----------------------------
*/
@pentagonal
pentagonal / MultiBytesEntities.php
Last active April 2, 2016 09:57
Entities Non ASCII characters
<?php
/**
* Entities the Multibytes string
* Iconv must be enable to use this function work properly
*
* @param string $string the string to detect multibytes
* @param boolean $entities true if want to entity the output
* @return string
*/
function multibyteEntities($string, $entities = true)