2016-01-21 59 views
0

我一直在尋找到PHP整潔,我看到了下面的代碼爲什麼一些PHP對象轉換爲字符串

$tidy = new tidy; 
$tidy->parseString($html, $config, 'utf8'); 
$tidy->cleanRepair(); 
// Output 
echo $tidy; 

Tidy這裏是一個對象。爲什麼不投擲Catchable fatal error: Object of class tidy could not be converted to string錯誤?

+0

重載_toString():HTTPS://coderwall.com/p/nx3bka/magic-method-make-an-object-echoable –

回答