SL8R.co.uk - Code Zone

Code, Code and Code

SL8R.co.uk - Code Zone header image 4

PHP: Require() and Include()

April 23rd, 2008 · No Comments

Essentially, require() and include() act in much the same way in that they both include the contents of another file - the only difference being that if include() fails then processing will continue (but produce a warning) but if require() fails then processing will stop with a fatal error (as well as produce the warning).

[...]

[Read more →]

Tags: Comment

PHP: Defining Constants

April 23rd, 2008 · 1 Comment

To define a constant, use the format:
define(constant_name,constant_value,case_insensitive)
e.g.
define(”MYCONSTANT”,”This is the value of the constant”,false);
print “Constant is ” . constant(”MYCONSTANT”);
?>

addthis_url = ‘http%3A%2F%2Fwww.sl8r.co.uk%2F2008%2F04%2F23%2Fphp-defining-constants%2F’;
addthis_title = ‘PHP%3A+Defining+Constants’;
addthis_pub = ”;

[Read more →]

Tags: Code