Created
April 22, 2015 20:07
-
-
Save triple-j/7215a4af574bd1bf261c to your computer and use it in GitHub Desktop.
credit to *ioaniatr* -- http://stackoverflow.com/a/26661737
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
function my_sql_regcase($str){ | |
$res = ""; | |
$chars = str_split($str); | |
foreach($chars as $char){ | |
if(preg_match("/[A-Za-z]/", $char)) | |
$res .= "[".mb_strtoupper($char, 'UTF-8').mb_strtolower($char, 'UTF-8')."]"; | |
else | |
$res .= $char; | |
} | |
return $res; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment