• Register
Welcome to phpanswers , where you can ask questions and receive answers from other members of the community.

Can we use include (”myfile.php”) two times in a PHP page and how will it affect to my output?

0 votes
asked 2 years ago by phpanswers (1,125 points)
edited 2 years ago by phpanswers

1 Answer

0 votes
You can include a php file any number of times as needed. But content of that file will be appear repeated. Ideally a file should get included only once in a php script.
to make sure a file gets included only once, u can use include_once() or require_once() function.
answered 2 years ago by kiran (230 points)

Related questions