I'm experimenting around which is faster and more efficient so I found my old scipt using fopen. How can I convert this to file_get_contents?
PHP:
class.......
$filename = 'test.txt';
$this->filepointer = fopen($filename, 'rb');
$length = filesize($filename);
public function read_name($length)
{
$name = fread($this->filepointer, $length);
return str_replace("\0", '', $name);
}
.....
can someone guide me how to convert it to file_get_contents?
Answer :