How do i read each line, and modify that line and ouput it then read the next and modify something else and the next and next line.....
Are you talking about a file content ?
I have a file. I want to read each line once by once because of the stuff I want to modify each sentence or line with something.
yes, it's file content
Ok !
$file_content = file("myfile.txt"); for($i = 0; $i < count($file_content); $i++) { $current_line = $file_content[$i]; // Make modifications to $current_line echo $current_line; // you may add <BR />\n }
File() reads a file and put it in an array... one line = one index, one value...
that almost got what I want. BUT.
You see I actually want to read each Sentence, sorry for my previous post.
I need to read each sentence and modify it.
What you gave me is to read each line.
Can you help me?
Does each sentence ends with a "." ? Or can it end with a "?" or a "!" ?