Forum Moderators: coopster

Message Too Old, No Replies

Newb question

reading from a txt file

         

mrcrash

3:06 am on Mar 21, 2003 (gmt 0)

10+ Year Member



Can anyone help me?

I have txt file that I want to search through and output the results.

Contents of txt
<<texttexttext n\iwantthis \moreinfo \moreinfo>>

My goal is getting all the stuff after the "\"
And output into a html page

jatar_k

6:22 am on Mar 21, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld mrcrash,

what language are you using? php?

mrcrash

7:54 am on Apr 1, 2003 (gmt 0)

10+ Year Member



yes, here is a link to my php info <snip>

[edited by: jatar_k at 3:03 pm (utc) on April 1, 2003]
[edit reason] no urls please [/edit]

jamesa

8:07 am on Apr 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So that's one line of the file, and the data is delimited by backslashes? If you read the line of the file into a variable called $line you can do this:

$your_array = explode ("\", $line);

Then...

$your_array[0] would be "texttexttext n"
$your_array[1] would be "iwantthis "
$your_array[2] would be "moreinfo "
$your_array[3] would be "moreinfo"