Answers for "php get current path"

PHP
2

php get url path name

parse_url( $_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH );
Posted by: Guest on November-04-2020
2

dir name php

<?php
dirname(__FILE__);
?>
Posted by: Guest on July-04-2020
0

php get file location

# C:\Users\Redacted\Desktop\main.php
include __DIR__ . DIRECTORY_SEPARATOR . 'include.php';
echoScriptPath();

# C:\Users\Redacted\Desktop\include.php
function echoScriptPath() {
    list($scriptPath) = get_included_files();
    echo 'The script being executed is ' . $scriptPath;
}
Posted by: Guest on June-19-2020
0

current pathinfo php

pathinfo($_SERVER['REQUEST_URI'])
Posted by: Guest on June-03-2021

Browse Popular Code Answers by Language