php resole relative to absolute

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ahmed786
    New Member
    • Apr 2010
    • 2

    #1

    php resole relative to absolute

    Hello ,

    I am a new in PHP.I have a task to resolve realtive path to absolute path.
    for example :
    ../default/test.png -> /image/default/test.png
    I have done it with string replace function.but,th is is not the solution.I need to resolve the relative path with base path such as
    /home/domainusers/workspace/picfinder/image/default/test.png.

    It's also possible the relative path would be like this "test.png". I have to resolve this also with the absolute path.
    /home/domainusers/workspace/picfinder/image/test.png.

    I have tried with so many function which are availaible on the Google:-).Still,I am not getting the certain result.

    Any help would be appreciated.

    Thanks In Advance :-)
    Mohamad Mujtaba Ahmed
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    check out realpath().

    Comment

    Working...