in PHP c'è il comando flush, basta fare
flush();