| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| SQLdumpster.com | Shortening (HTML/PHP) Hey all. I'm sure this is quite simple but basically I'm displaying a text file in a textarea but only want to display a certain number of lines. I'm using 'fread' but I think you can only set the number of bytes rather than number of lines. Anyway, there are three ways I'm looking at doing it: 1. With the fread function, somehow. 2. When the contents of the text file are stored as a variable. 3. ..or with the 'textarea' field itself. Just need a little bit of guidance. Thanks
__________________ !!!!!!! see something you like? Accepting offers for great affiliate websites !!!!!!! Free Databases for your Website | All Things Playstation 3 Website Design Books | Music While You Work? | Computer Gadgets |
| |
| | #2 (permalink) |
| NPQ's PA, Slave, and On Call Coder Technical Services | Something like this: PHP Code:
__________________ |
| |
| | #3 (permalink) |
| SQLdumpster.com | Thanks for the help. Small donation sent
__________________ !!!!!!! see something you like? Accepting offers for great affiliate websites !!!!!!! Free Databases for your Website | All Things Playstation 3 Website Design Books | Music While You Work? | Computer Gadgets |
| |
| | #4 (permalink) |
| Barru. | Small update for SV's code. You can replace: PHP Code: PHP Code:
__________________ |
| |
| | #5 (permalink) |
| Domains my Dominion | http://php.net/manual/en/function.fgets.php: Reading a file line by line PHP Code:
__________________ Buy now - MassDeveloper.com $500 |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |