note 109906 deleted from function.file-get-contents by salathe

From: Date: Mon, 21 Sep 2020 14:38:59 +0000
Subject: note 109906 deleted from function.file-get-contents by salathe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-215248@lists.php.net to get a copy of this message
Note Submitter: andrew at 21cv dot co dot uk ---- Negative offsets don't work as you might expect (like in http://php.net/substr for example) So <?php echo file_get_contents(__FILE__, false, null, -10) ?> does the same as <?php echo file_get_contents(__FILE__, false, null, 0) ?> To get the last 10 characters of a file, you need to use <?php echo file_get_contents (__FILE__, false, null, (filesize (__FILE__) - 10)) ?>

« previous php.notes (#215248) next »