Hello,
1_ What is the difference between @include() and include() ?
2_ Is there a way to make an include of file relative to the current script that include it instead of the current directory ?
Thanks
@include
Moderator: General Moderators
1. @ supresses errors
2. Put your files to be includes in a directory, add that directory to your include_path. Then you can include any of the files in the directory you previously specified from anywhere (i.e any file in any directory) by just doing require_once 'foo.php' or include_once 'foo.php' ... as long as foo.php is in your newly created include directory.
2. Put your files to be includes in a directory, add that directory to your include_path. Then you can include any of the files in the directory you previously specified from anywhere (i.e any file in any directory) by just doing require_once 'foo.php' or include_once 'foo.php' ... as long as foo.php is in your newly created include directory.
You can set it in your php.ini file, in a vhost directive in your httpd.conf, in a .htaccess file, use ini_set, or use set_include_path if you have PHP >= 4.3.0