Look at the code below
<?php
//get current executing page
//you get the full directory path
//ex: /test/path.php
$file_path = $_SERVER["SCRIPT_NAME"];
//so we expolde it into an array
$parts = Explode('/', $file_path);
//need to get the last element from array
$file_name = $parts[count($parts) - 1];
echo $file_name; //path.php
?>
Get Free Sinhala IT Learning Videos Kuppiya.com
No comments:
Post a Comment