Answers for "php file extension"

PHP
11

php get file extension from filename

$ext = pathinfo($filename, PATHINFO_EXTENSION);
Posted by: Guest on October-26-2020
2

php files

<html>

   <head>
      <title>Reading a file using PHP</title>
   </head>
   
   <body>
      
      <?php
         $filename = "tmp.txt";
         $file = fopen( $filename, "r" );
         
         if( $file == false ) {
            echo ( "Error in opening file" );
            exit();
         }
         
         $filesize = filesize( $filename );
         $filetext = fread( $file, $filesize );
         fclose( $file );
         
         echo ( "File size : $filesize bytes" );
         echo ( "<pre>$filetext</pre>" );
      ?>
      
   </body>
</html>
Posted by: Guest on July-16-2020
-2

php file extension

$ext = end(explode(".",file_name));
Posted by: Guest on September-04-2020
0

php file extension

$ext=pathinfo($file, PATHINFO_EXTENSION);
Posted by: Guest on October-09-2021

Browse Popular Code Answers by Language