PDA

View Full Version : REQ. displaying sections from text file



centrifuge
03-13-2009, 06:08 PM
If you respond, please give an example as my "expertise" is "nil".

In searching this forum, I've come up with:
txtfile.txt
one=this is the first section
two=this is the second section
three=this is the third section
AND

<?php
list(, $content) = explode('two=', file_get_contents('txtfile.txt'));
echo $content;
?>

Problem being: "this is the second section three=this is the third section" displays, rather than "this is the second section".

From what I see here, "trim" can be used to solve this.

After several hours, trying every possibility I could think of, I am admitting defeat and begging for help...please. :(

rafiki
03-13-2009, 06:54 PM
You would have to explode the variable which contains part two by partthree and use the $var['0'];

centrifuge
03-13-2009, 07:04 PM
You would have to explode the variable which contains part two by partthree and use the $var['0'];As I said, please give an example as my "expertise" is "nil".

Also, would you please explain why "trim" wouldn't work if the correct syntax were used.