Rukmi Patel
Rukmi Patel

Reputation: 2561

include() is giving me error

my code for the page id like this

PAGE NAME : test.php

content :

ob_start();
include("test.php");
$GeneratedHTML = ob_get_contents();
ob_end_clean();
echo $GeneratedHTML;

which give me error like this

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 40961 bytes) in D:\xampp\htdocs\test.php on line 2

can anyone tell me why it is giving me error when I am including same file.

Upvotes: 1

Views: 88

Answers (1)

Richard Parnaby-King
Richard Parnaby-King

Reputation: 14891

You have an infinite loop.

test.php is including test.php which is including test.php which is...

Rename either the file you are including, or the name of the file this code is in.

Upvotes: 4

Related Questions