Reputation: 16061
I am calling code like
strtr($somevars['thisvar'], "abc")
Where $somevars['thisvar']
contains a string.
And it's giving me
Warning: strtr() [function.strtr]: The second argument is not an array
Why?
Upvotes: 0
Views: 2489
Reputation: 39859
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 :)
Upvotes: 1
Reputation: 96159
Warning: strtr() [function.strtr]: The second argument is not an array
strtr != strstr
see: http://docs.php.net/strtr
Upvotes: 9