Retrieve current URL aftr

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • londres9b
    New Member
    • Apr 2010
    • 106

    #1

    Retrieve current URL aftr

    I want to retrieve

    http://www.mysite.com/directory/page.php

    just directory/page.php

    How do I do that?
  • chimpu
    New Member
    • May 2010
    • 1

    #2
    Retrieve current URL aftr

    Well , use string explode function and then you will get your result .
    See the code below


    Code:
    <?php
    /**
    code owner: Rahul Sinha
    contact : [email]rahul@zimaudio.com/rahulazm@gmail.com[/email]
    **/
    $str='http://www.mysite.com/directory/page.php';
    $arr = explode("com/",$str);
    echo $arr[1]; // prints directory/page.php
    
    ?>
    Regards,
    Chimpu
    Last edited by Dormilich; Jun 20 '10, 09:53 PM. Reason: Please use [code] tags when posting code

    Comment

    • londres9b
      New Member
      • Apr 2010
      • 106

      #3
      very thanks!

      Comment

      • londres9b
        New Member
        • Apr 2010
        • 106

        #4
        I have a related follow up question

        Comment

        Working...