When I was writing my code in PHP and typed require
instead include
, I saw there was no difference between them so I want to know the main difference between include_once
and require_one
and include
and require
.
Asked
Active
Viewed 141 times
2

Pranav MS
- 2,235
- 2
- 23
- 50

Pooja Khatri
- 550
- 5
- 11
-
Have you read the [documentation](http://php.net/manual/en/function.include-once.php)? – axiac Aug 10 '17 at 06:17
1 Answers
0
require()
and require_once()
perform the same task except that the second function checks if the PHP script is already included or not before executing it.
(same for include_once()
and include()
)

Pranav MS
- 2,235
- 2
- 23
- 50