using file()

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
misfitxnet
Forum Newbie
Posts: 14
Joined: Mon May 11, 2009 8:40 am

using file()

Post by misfitxnet »

When I use file() on a text file,
with the format of $a."/t".$b, etc etc,
so that I may turn it into an array

I cannot return any of the values of the new array
the only return value i get in the browser is "Array"
And that is it.

Is there a way to work with files or arrays like this?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: using file()

Post by s.dot »

file() will take each line of the file and make it an element in the array
use print_r() to show arrays in your browsers
if you're using a tab delimited file, fgetcsv() may be a better choice for you
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply