Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php current file name

basename(__FILE__, '.php'); 
Comment

get file name from file path in php

<?php
$path_parts = pathinfo('/www/htdocs/inc/lib.inc.php');

echo $path_parts['dirname'], "
";
echo $path_parts['basename'], "
";
echo $path_parts['extension'], "
";
echo $path_parts['filename'], "
"; // since PHP 5.2.0
?>
Comment

filename php

echo "1) ".basename("/etc/sudoers.d", ".d").PHP_EOL;//sudoers
echo "2) ".basename("/etc/sudoers.d").PHP_EOL;//sudoers.d
echo "3) ".basename("/etc/passwd").PHP_EOL;//passwd
echo "4) ".basename("/etc/").PHP_EOL;//etc
echo "5) ".basename(".").PHP_EOL;//.
echo "6) ".basename("/");//
Comment

php get filename

<?php
    $xmlFile = pathinfo('/usr/admin/config/test.xml');

    function filePathParts($arg1) {
        echo $arg1['dirname'], "
";
        echo $arg1['basename'], "
";
        echo $arg1['extension'], "
";
        echo $arg1['filename'], "
";
    }

    filePathParts($xmlFile);
?>
Comment

PREVIOUS NEXT
Code Example
Php :: wordpress enqueue if shortcode 
Php :: laravel datatable addColumn not working 
Php :: array_merge 
Php :: toastr in php 
Php :: laravel invoice toturial 
Php :: remove blank data in multidimention array in laravel 
Php :: mp3 file upload code in php 
Php :: How to Customize WooCommerce Breadcrumb 
Php :: wordpress - php settings 
Php :: Displaying Custom Navigation Menus in WordPress Themes 
Php :: how to create constant in php 
Php :: image upload in php code with databases 
Php :: PHP MySQL Insert Multiple Records 
Php :: laravel order by before group by 
Php :: Main features of php 
Php :: laravel 9 excel 
Php :: get all error message in array form laravel validation in laravel 
Php :: php library to convert html to amp 
Php :: Diferencia entre dias PHP - Con date_diff() 
Php :: laravel collection combine 
Php :: composer install phpWord 
Php :: checks if file is empty in php 
Php :: laravel basic login 
Php :: php get duplicate keys in array without using inbuilt function 
Php :: laravel valet subdomain 
Php :: get woocommerce my account page url 
Php :: laravel run schedule only on production 
Php :: codeigniter 3 image upload 
Php :: php strict mopde 
Php :: Regex to remove span tags using php [duplicate] 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =