Page 1 of 1
Help with modify a script.
Posted: Wed Dec 16, 2009 9:01 pm
by joegats916
Hi.. I'm trying to modify this script so that it only prints 100 bytes of the data in the file, no matter how big the file is.. then after the $text print "..." to indicate that it's been cut off.
Code: Select all
<?php
$text = nl2br(file_get_contents('content/calendardata/cdate2.data'));
echo $text;
?>
Thanks!
Re: Help with modify a script.
Posted: Wed Dec 16, 2009 9:39 pm
by requinix
1. file_get_contents
2.
substr
3. nl2br
Re: Help with modify a script.
Posted: Wed Dec 16, 2009 9:41 pm
by joegats916
It would be an understatement to say that i'm ubernoobish, could you explain that in a little more detail.
Re: Help with modify a script.
Posted: Wed Dec 16, 2009 9:49 pm
by daedalus__
its pretty self explanatory once you read the manual. you could have kept this in the other thread.
go ahead and head over to php.net and look those functions up.
you could also use the file reading functions to produce the same results.