0

Hey,
How can I cause a block of php code be executed once using a command like the include_once();If i use this directly it includes the contents of the include file like HTML content!
What can I do?:$

5
Contributors
5
Replies
6
Views
10 Years
Discussion Span
Last Post by vdeych
0

what block of code are you trying to execute?if php file then you can exclude your html content if you want to or better yet use functions.

0

Thanks,
Actually I made my fuction inside a loop
I a certain case it should parse only once so I thought of using the include once to do this but It printed all the contents of the included file like plain html.
I dont have the code here since I'm working in a cyber

0

You can execute a block of PHP code in plain text directly. I would recommend taking a look at the eval() function, as that will allow you to do what your trying to do (as far as I know).

0

Inside the loop:

$executed = false;

if(!$executed) {

 //  Your block of code
 call_me_only_once();

 $executed = true;
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.