ehikioya.com
How To Echo Into A Variable Using PHP Output Buffering - Ehi Kioya
"Echo" is a PHP language construct used to output strings. But if you want to send its output to a variable, you need PHP output buffering.