Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

include_once or require_once

Status
Not open for further replies.

mancroft

Programmer
Joined
Oct 26, 2002
Messages
267
Location
GB
include_once or require_once?

Anyone know the difference between

include_once "xxsql.php";

and

require_once("xxsql.php");

?

Which is better?
Thanks.
 
Not better. Different in how the two functions handle failure.

include() (and include_once()), on failure, issues a warning.

require() (and require_once()), on failure, issues a fatal error.

This is documented here





Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Thanx again, sleipnir214
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top