PHP function returns path from array of directory names, without double pathname separators.
Sometimes in configuration files, I might have to set up various directory paths, from which a valid pathname has to be constructed. Often it is not clear whether an initial or final slash (”/”) is required, and sometimes different parts of the program may have different requirements.

Simon Tite 8:30 pm on November 7, 2009
This simple PHP function merges an array of directory or file names, to compose a full pathname, if any of the elements of the array contain superfluous directory separators, doubled separators are merged into one.
Example of usage:
…gives the result:
/data/styles/my.css