Created
December 25, 2012 11:26
-
-
Save macik/4372764 to your computer and use it in GitHub Desktop.
Converts old string PHP functions for multibyte anologs.
This file contains 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 | |
$filename = 'header.php'; // File name | |
$search[] = 'mail('; $replace[] = 'mb_send_mail('; | |
$search[] = 'strlen('; $replace[] = 'mb_strlen('; | |
$search[] = 'strpos('; $replace[] = 'mb_strpos('; | |
$search[] = 'strrpos('; $replace[] = 'mb_strrpos('; | |
$search[] = 'substr('; $replace[] = 'mb_substr('; | |
$search[] = 'strtolower('; $replace[] = 'mb_strtolower('; | |
$search[] = 'strtoupper('; $replace[] = 'mb_strtoupper('; | |
$search[] = 'stripos('; $replace[] = 'mb_stripos('; | |
$search[] = 'strstr('; $replace[] = 'mb_strstr('; | |
$search[] = 'stristr('; $replace[] = 'mb_stristr('; | |
$search[] = 'strrchr('; $replace[] = 'mb_strrchr('; | |
$search[] = 'substr_count('; $replace[] = 'mb_substr_count('; | |
$search[] = 'ereg('; $replace[] = 'mb_ereg('; | |
$search[] = 'eregi('; $replace[] = 'mb_eregi('; | |
$search[] = 'ereg_replace('; $replace[] = 'mb_ereg_replace('; | |
$search[] = 'eregi_replace('; $replace[] = 'mb_eregi_replace('; | |
$search[] = 'split('; $replace[] = 'mb_split('; | |
$file = file_get_contents($filename); | |
$file = str_replace($search,$replace,$file); | |
file_put_contents($filename,$file); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment