how i can get file name without its extension
i have a zip file \'file-no:50.zip\'
how i can get only file-no:50 with out .zip using the php
1 Answer
Check out pathinfo(), it gives you all the components of your path.
Example from the manual: <?php $path_parts = pathinfo('/www/htdocs/index.html'); echo $path_parts['dirname'], "\n"; echo $path_parts['basename'], "\n"; echo $path_parts['extension'], "\n"; echo $path_parts['filename'], "\n"; // since PHP 5.2.0 ?>and alternatively you can get only certain parts like echo pathinfo('/www/htdocs/index.html', PATHINFO_EXTENSION); // outputs html Posted: MacOS 0 of 0 people found this answer helpful. Did you? Yes No |
© Advanced Web Core. All rights reserved