7/24/2016

PHP : หาว่าหน้าที่อยู่นั้นชื่อไฟล์อะไร เพื่อนำไปใช้งานต่อ

PHP : หาว่าหน้าที่อยู่นั้นชื่อไฟล์อะไร เพื่อนำไปใช้งานต่อ

    <?php
    function curPageName() {
     return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
    }
     
    echo "The current page name is ".curPageName();
    ?>
     
     
      ที่มา http://webcheatsheet.com/php/get_current_page_url.php

      No comments:

      Post a Comment