1

i have already searched internet and (php mannual too a little hard to understand) but didn't get satisfied about php's set_include_path, i know that its used to set the include path for the running script,but i dont quit understand what does PATH_SEPARATOR constant do in php set_include_path function.

so for example

set_include_path('./php-include'.PATH_SEPARATOR.'./functions');

i don't quiet get it please some one explain it thanks in advance.

0

2 Answers 2

1

PATH_SEPARATOR is the character that's used to separate multiple paths in a string, such as the include_path.

On Unix, PATH_SEPARATOR is ':' while on Windows it's ';'

Sign up to request clarification or add additional context in comments.

Comments

1

PHP's include path can have multiple directories, that are searched in order for the file you are trying to include. The way that was chosen to list many directories is to separate the directories with a character that they know will never appear in a directory's name.

For instance, on Windows, ; is such character. So, when PHP needs to find a file, it can simply split the string representing the various include paths on each occurrence of the ; character and search for the file in each of the directories.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.