Following is the piece of code, which will definitely be helpful for your development...
// Start of code
ob_start();
$strBody="Hi, There is an Error in creating Class Object while script was in second loop. Record Id :".$records["recordDetailsId"];
print_r($objClass);
$strBody.=ob_get_contents();
ob_end_flush();
mail("foo@mycompany.com","Error in Creating Object ",$strBody,"From: My Site
// End of code
So you can easily find how only three functions i.e. ob_start() , ob_get_contents() and ob_end_flush() serve the purpose ...
More details about these functions can be found at php.net
Hi Uday,
ReplyDeleteYeah.. Correct you are, it can also be done with second parameter to print_r function. I was interested in explaining and giving basic introduction of buffering functions though. :)