Created
November 29, 2011 11:22
-
-
Save fetus-hina/1404467 to your computer and use it in GitHub Desktop.
mb_str_replace() 説明ページ用互換性注意事項
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 | |
$subject = 'hogefuga'; | |
$table = array('hoge' => 'foo', | |
'fuga' => 'bar', | |
'piyo' => 'baz', | |
'foo' => '***', | |
'bar' => '+++', | |
'baz' => '---'); | |
$functions = array('str_replace', 'mb_str_replace'); | |
foreach($functions as $f) { | |
$result = $f(array_keys($table), array_values($table), $subject); | |
printf("%s: %s\n", $f, $result); | |
} |
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
str_replace: ***+++ | |
mb_str_replace: foobar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment