phpinclude-pathset-include-path

PHP set_include_path statement


I can't quite figure out the meaning of this statement:

set_include_path('.'
. PATH_SEPARATOR . '../library/'
. PATH_SEPARATOR . '../application'
. PATH_SEPARATOR . get_include_path());

A quick breakdown would be appreciated.


Solution

  • It adds the two paths to the include_path so that if you include a file "../library/filename.php". you can do it by

    include('filename.php');
    

    instead of

    include('../library/filename.php');
    

    I suppose this is a part of some framework

    It basically adds the folder to the php include path