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 | |
function mysql_escape_mimic($inp) | |
{ | |
if(!empty($inp) && is_string($inp)) { | |
return str_replace(array('\\', "\0", "\n", "\r", "'", '"', "\x1a"), array('\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z'), $inp); | |
} | |
return $inp; | |
} |
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 | |
function utf8_strrev($str) { | |
return iconv("UTF-16LE", "UTF-8", strrev(iconv("UTF-8", "UTF-16BE", $str))); | |
} |
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 | |
function genUniqueFileName($fullPathToFile) | |
{ | |
$pathInfo = pathinfo($fullPathToFile); | |
$k = 1; | |
$uniquePath = $fullPathToFile; | |
while (file_exists($uniquePath)) { | |
$uniquePath = $pathInfo['dirname'] . '/' . $pathInfo['filename'] . '-' . $k++ . '.' . $pathInfo['extension']; | |
} | |
NewerOlder