capture output buffer from PHP script