www.webdeveloper.com
Results 1 to 5 of 5

Thread: [RESOLVED] How to Get Only the File Name From the Current URL??

  1. #1
    Join Date
    Apr 2008
    Location
    Mumbai, India
    Posts
    255

    resolved [RESOLVED] How to Get Only the File Name From the Current URL??

    Hi....

    I am posting several questions..But til now I didnt get even a single answer to any one of those....... I dont know the reason....

    Still Hope remains in me and posting new one....

    Plz giv me the Solution......

    How can I get only the FileName of the Current URL???


    Thanks a lot in Advance.....I need solution to this....Even thought it wont work it doesn't matter.....

    Hope i will get a solution.....

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Apr 2008
    Location
    Mumbai, India
    Posts
    255
    Thanks a lot...

    But my url contains something like this.....index.php?page=2&order=L

    In this case how can I get only the file name as "index.php"

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    <?php
    $url  = "http://www.myweb.com/cgi-bin/sales.pgm?vendor=1234&user=robin&po=1000";
    $fileName= explode(".", basename($url));
    echo $fileName[0];
    ?>
    At least 98% of internet users' DNA is identical to that of chimpanzees

  5. #5
    Join Date
    Apr 2008
    Location
    Mumbai, India
    Posts
    255

    My problem Solved...

    Thanks a lot....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles