JT91
JT91

Reputation: 45

php - output buffering ob_get_contents not returning anything

I am trying to generate a static HTML from php however, i cannot get anything to output to $page, any ideas? cheers

ob_start();
$pageident = $tempdbid;   
include 'newpagegenerator.php';
$page  = ob_get_contents();
ob_end_clean();

Upvotes: 2

Views: 546

Answers (1)

You need to output it using an echo statement.

ob_start();
$pageident = $tempdbid;   
include 'newpagegenerator.php';
$page  = ob_get_contents();
echo $page;//<----- echo here
ob_end_clean();

Upvotes: 1

Related Questions