note 109906 added to function.file-get-contents
| From: | andrew at 21cv dot co dot uk | Date: | Sun, 02 Sep 2012 10:47:43 +0000 |
| Subject: | note 109906 added to function.file-get-contents | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-190413@lists.php.net to get a copy of this message | ||
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)) ?>
----
Server IP: 94.76.225.145
Probable Submitter: 80.229.223.240
----
Manual Page -- http://www.php.net/manual/en/function.file-get-contents.php
Edit -- https://master.php.net/note/edit/109906
Del: integrated -- https://master.php.net/note/delete/109906/integrated
Del: useless -- https://master.php.net/note/delete/109906/useless
Del: bad code -- https://master.php.net/note/delete/109906/bad+code
Del: spam -- https://master.php.net/note/delete/109906/spam
Del: non-english -- https://master.php.net/note/delete/109906/non-english
Del: in docs -- https://master.php.net/note/delete/109906/in+docs
Del: other reasons-- https://master.php.net/note/delete/109906
Reject -- https://master.php.net/note/reject/109906
Search -- https://master.php.net/manage/user-notes.php