Returns a string path built from the array $pathParts. Where a join occurs multiple separators are removed. Joins using the optional separator, defaulting to the PHP DIRECTORY_SEPARATOR constant.
Returns the temp directory according to either the TMP, TMPDIR, or TEMP env variables. If these are not set it will also check for the existence of /tmp, %WINDIR%\temp