title: How to join filesystem path strings in PHP?
body: <p>Is there a builtin function in PHP to intelligently join path strings? The function, given <code>abc/de/</code> and <code>/fg/x.php</code> as arguments, should return <code>abc/de/fg/x.php</code>; the same result should be given using <code>abc/de</code> and <code>fg/x.php</code> as arguments for that function.</p>
  <p>If not, is there an available class? It could also be valuable for splitting paths or removing parts of them. If you have written something, may you share your code here?</p>
  <p>It is ok to always use <code>/</code>, I am coding for Linux only.</p>
  <p>In Python there is <code>os.path.join</code>, which is great.</p>