fopen
Posted: Mon May 15, 2006 10:43 am
Hey, this isn't really any code that i'll show, but i'm wondering if you somehow can go to a specefic row number using fopen in the file you are editing?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$contents = file_get_contents($filename);
$row = explode("\n", $contents);
// to access the specific row use the following (row_you_want - 1)
// if you want row 30, then you would get 29
echo $row[29];Code: Select all
<?php
$file = file('yourfile');
// Echo out line 519
echo $file[519];
?>