Resolving directory traversal
djpth('/parent/subsite/../../global/css/file.css')


returns

/parent/../file.css    


I guess that is not what you want.
If the file exists I'd use the built-in realpath function. I guess it handles corner case like this and another ones better.

(See also: Effective Java, 2nd edition, Item 47: Know and use the libraries)
$pth is used for multiple purposes. It would be easier to read a $path and a $path_array.
Abbreviations are hard to read, like $pth. Longer names would make the code more readable since readers don't have to decode the abbreviations every time and when they write/maintain the code don't have to guess which abbreviation the author uses.

Furthermore, it's hard to pronounce (as well as djpth).


  If you can’t pronounce it, you can’t discuss it without sounding like an idiot. “Well,
  over here on the bee cee arr three cee enn tee we have a pee ess zee kyew int, see?” This
  matters because programming is a social activity.


Source: Clean Code by Robert C. Martin, Use Pronounceable Names, p21
Comments like this are just noise:


// Iterate through the new array



It's obvious from the code itself. (Clean Code by Robert C. Martin: Chapter 4: Comments, Noise Comments)

$pth = implode('/',$pth);
// Then we return the resolved path
return $pth;



The comment above could be eliminated with a better variable name:

$resolved_path = implode('/', $path_array);
return $resolved_path;