Answers for "how to open a php file"

PHP
0

how to open php in browser

php -S localhost:8000
Posted by: Guest on January-15-2021
0

.php file

<html>

   <head>
      <title>Reading a file using PHP</title>
   </head>
   
   <body>
      
      <?php
         $filename = "abc.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>
        //This is a php File Yes!!!!!
Posted by: Guest on October-08-2020

Browse Popular Code Answers by Language