When I tried the

$file_contents = explode(",",$file_contents);

I get the error:

Notice: Array to string conversion in
c:\inetpub\wwwroot\webpage10\example\search\dsp_search.php on line 111

When I do

echo ($file_contents);

the output is Array.  When I do

echo ($file_contents[0]);

I get all the content of file, so everything is in array 0.  I need to
somehow break up the array by the comma.


"Chris W. Parker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Micah Montoy <mailto:[EMAIL PROTECTED]>
    on Tuesday, August 12, 2003 3:35 PM said:

> I have this text file that I pull in and I need to transverse through
> the file and assign each value in the file into an array.

Hehe... you mean traverse.

Transverse:
1 : acting, lying, or being across : set crosswise
2 : made at right angles to the anterior-posterior axis of the body <a
transverse section>

> The text in the file is separated by a comma.

This is called "delimit".

You say the file looks a bit like "and,not,it,i,a,c,nope". Are there any
new line characters (\n) in the file or is it just one really long line?
If there ARE newlines in the file does it look like this:

a,b,c,d,e,f,g,
h,i,j,k,l,m,n,

or this:

a,b,c,d,e,f,g
h,i,j,k,l,m,n

??

(notice there is no comma at the end of the line in the second example)


Chris.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to