Link to home
Start Free TrialLog in
Avatar of Pedro Chagas
Pedro ChagasFlag for Portugal

asked on

php - read file and show the content

Hi E's, I need to know how I read a .htm file and show the contain line by line?

The best regards, JC
SOLUTION
Avatar of cyberstalker
cyberstalker

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Pedro Chagas

ASKER

Thanks @cyberstalker,
It's possible put the data in array, like each line in array?

The best regards, JC
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Does cyberstalker's reply answer your question or do you need more help?
Hi again, just one thing for finish:
I get the last code of @cyberstalker, and they work well, the script give me each line in differente arrays.
The problem is when I show the array, the data appear like the real site, if I have a link, appear the link but not the code.
You can check in the attach image.
How I can see the real code of the file?

Regards, JC
<?php
$lines = explode("\n", file_get_contents('indexes.htm')); ?>
<pre> 
<?
print_r($lines);
?>
</pre>

Open in new window

04-10-2011-19-17-29.png
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In this case, if I want write other file with the code I get from the old file, I can?

Regards, JC
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial