Using the fseek() Function
<?php $fr = fopen('data.dat', 'r'); if(!$fr) exit; fseek($fr, 10); fseek($fr, -10, SEEK_END); fseek($fr, 2, SEEK_CUR); ?>