File Read

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sujithfem
Forum Newbie
Posts: 23
Joined: Tue May 23, 2006 10:56 pm
Location: India
Contact:

File Read

Post by sujithfem »

hi
I wanna code which is use to display the following only ,Ref doc , Reference ,the datas are in text file like

Run no. Ref. doc. Reference Pers.no.

1000003074 1000498611 1250047681/000 20012163
1000003074 1000498611 1250047681/000 20012163

1000003074 1000498612 1250047780/000 20012260
1000003074 1000498612 1250047780/000 20012260

I need to display Ref doc , Reference from above code by php ,please let me know the solution .....
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

sujithfem
Forum Newbie
Posts: 23
Joined: Tue May 23, 2006 10:56 pm
Location: India
Contact:

Post by sujithfem »

I got but i need 2nd and 3rd column of the specified text file please let me know the solution for the same
<?php
$lines = file('test.txt');


foreach ($lines as $line_num => $line) {
echo $line."</br>\n";
}
?>

Test.text

Run no. Ref. doc. Reference Pers.no.

1000003074 1000498611 1250047681/000 20012163
1000003074 1000498611 1250047681/000 20012163

1000003074 1000498612 1250047780/000 20012260
1000003074 1000498612 1250047780/000 20012260
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

as I said, possibly explode().
Post Reply