Strtr requires an array as the second argument?
I am calling code like
strtr($somevars['thisvar'], "abc")
Where $somevars['thisvar']
contains a string.
And it's giv开发者_JAVA技巧ing me
Warning: strtr() [function.strtr]: The second argument is not an array
Why?
Warning: strtr() [function.strtr]: The second argument is not an array
strtr != strstr
see: http://docs.php.net/strtr
You have two possibilties for strtr:
string strtr ( string $str , string $from , string $to );
string strtr ( string $str , array $replace_pairs );
So even you add a third parameters and you can use a string, or you set an array and don't add a third parameter :)
精彩评论