php get file contents
<?php
file_get_contents("file.txt");
?>
.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!!!!!
what is php file
PHP files can contain text, HTML, CSS, JavaScript, and PHP code.
PHP code is executed on the server, and the result is returned to the browser as plain HTML.
PHP files have extension ".php
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us