Jul 13, 2007 #1 Sleidia Technical User May 4, 2001 1,284 FR Hi How do you translate an absolute filesystem path ( D:/root/dir1/ ) into a relative url ( ../../dir1/ ) ? Thanks
Hi How do you translate an absolute filesystem path ( D:/root/dir1/ ) into a relative url ( ../../dir1/ ) ? Thanks
Jul 13, 2007 #2 jpadie Technical User Nov 24, 2003 10,094 FR i don't think that's straightforward. i'd probably take the realpaths of the current directory (__DIR__) and the absolute path you're testing and then compare the two. then, having got the comparison, compare the resultant to the current $_SERVER['DOC_ROOT'] here is a link which should give you a pseudo code for achieving this http://www.zsh.org/mla/users/2002/msg00262.html Upvote 0 Downvote
i don't think that's straightforward. i'd probably take the realpaths of the current directory (__DIR__) and the absolute path you're testing and then compare the two. then, having got the comparison, compare the resultant to the current $_SERVER['DOC_ROOT'] here is a link which should give you a pseudo code for achieving this http://www.zsh.org/mla/users/2002/msg00262.html