PHP fopen from another .php file -
i'm trying print out content of php file.
here how trying print it.
$filename = "read.php"; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); fclose($handle); print $contents;
the method above found didn't work. didn't print on screen.
can tell me how fix this.
also want know how write .php , and save it.
note: i'm not trying print output of php file. example: if read.php
<?php echo "hello world"; ?>
want print out <?php echo "hello world"; ?>
not "hello world"
why not ?
<?php echo htmlspecialchars(file_get_contents('read.php'));
Comments
Post a Comment