- ob_start: documentation ( source)
<?php
class AnotherClass{
public $world = "world";
}
$anotherClass = new AnotherClass();
ob_start("callback");
function callback($input){
global $anotherClass;
return $input.$anotherClass->world;
}
echo "hello";