Strtr function actually appears catchable fatal error
Error message:
Catchable fatal error:object of class variant could not being converted to string in d:wwwphpnowhtdocsxmlincxmlclass.php on Line 160
160 lines of code: return $tab 1.STRTR ($content, Array (' > ' = ' < ', ' < ' = ' + ' > ', ' & ' = ' & ', ' ' ' ' ' = ' ', ' ' ' "=");
Copy code 160 lines around code function encode ($content, $type = ' element ', $tab 1= ', $br = ') {if ($type = = ' Element ') {return $tab 1.STRTR ($ Content,array (' > ' = ' < ', ' < ' + ' > ', ' & ' = ' & ', ' ' ' ' + ', ' ', ' ' ', ' ' and ' ') '); }elseif ($type = = ' CDATA ') {return ', ']] > ', $content). $br. ']]> '; } }
Copy code has never come across.
I remember that this problem only occurs when the php+access is read.
I searched the Internet for 2 hours and found all the Chinese and English. I can't find a clue.
See the full code for the class:
[url=http://www.souzz.net/html/edu/php/php8/6590.html] link marker http://www.souzz.net/html/edu/php/php8/6590.html[/ Url
[ ]
I'll answer that.
d8888d Huitie Content-------------------------------------------------------
$content this is a class. It's not a string.
d8888d Huitie Content-------------------------------------------------------
Originally Posted by Tankme on 2009-3-5 22:26 [url=http://bbs.111cn.cn/redirect.php?goto=findpost&pid=894659&ptid=107280] Link marker [Img]http://bbs.111cn.cn/images/common/back.gif[/img][/url]
$content this is a class. It's not a string.
Can you make it a little more specific? I don't understand.
d8888d Huitie Content-------------------------------------------------------
It is clear from the error prompt that the object cannot be output directly to a string in php5, and if such a function is to be implemented, the __tostring () method is implemented in the object's base class.
That is, in the landlord's code $content is such an object
http://www.bkjia.com/PHPjc/632555.html www.bkjia.com true http://www.bkjia.com/PHPjc/632555.html techarticle strtr function unexpectedly appears catchable fatal error hint: catchable fatal Error:object of class variant could not being converted to Stri Ng in d:wwwphpnowhtdocsxmlincxmlclass.ph ...