Get File Refer Without File Extension Inward Php
Definition in addition to Usage - basename() The basename() component division returns the filename from a path. Syntax basename(path,suffix) Parameter Description path Required. Specifies the path to check suffix Optional. Specifies a file extension. If the filename has this file extension, the file extension volition non show Example <?php $path = "/testweb/home.php"; //Show filename amongst file extension echo basename($path) ."<br/>"; //Show filename without file extension echo basename($path,".php"); ?> The output of the code inwards a higher identify volition be: home.php home You convey to know the extension to take it inwards advance though. You tin laissez passer the sack exercise pathinfo() in addition to basename() together if you lot don't know the extension of the file. First cash inwards one's chips the extension using pathinfo(), in addition to exercise the basename function, si...