user286770
user286770

Reputation:

How are constants defined and used in PHP?

my pages ref this line

require_once(LIBDIR."client.php");

where and how do I define the LIBDIR variable?

thanks

Upvotes: 2

Views: 82

Answers (1)

Phil Rykoff
Phil Rykoff

Reputation: 12087

well it should have been defined before using it, e.g:

define("LIBDIR", "/usr/foo/bar/");

if you use an unescaped string like LIBDIR, it may be a constant. if it was not declared as a constant, depending on your php-settings, it may be automatically castet as a constant.

Upvotes: 4

Related Questions