Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[PHP] Read file array

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Localhost
I post too much
Reputation: 0

Joined: 28 Apr 2007
Posts: 3402

PostPosted: Sun Sep 07, 2008 8:39 pm    Post subject: [PHP] Read file array Reply with quote

How can i read a file line by line?

so...

----- welcome.txt ----
hey
hello
ohai thar
--------------------------

so $file[0] would output hey
$file[1] would output hello
$file[2] would output ohai thar
etc etc

_________________
Back to top
View user's profile Send private message MSN Messenger
ElectroFusion
Grandmaster Cheater
Reputation: 0

Joined: 17 Dec 2006
Posts: 786

PostPosted: Sun Sep 07, 2008 9:14 pm    Post subject: Reply with quote

I hate to inform you, but this is possible. I will spoonfeed you!

$string = fopen('file.txt', r);
$output = explode('\n', $string, -1));
echo $output;

But i'm not sure if this will work, unless you put \n at the end of each line.
Try it out and see.

EDIT : Fixed it. it said w but I changed it to r.

_________________
qwerty147 wrote:

ghostonline wrote:

what world are you in?

bera

but i live in NZ
Back to top
View user's profile Send private message
Localhost
I post too much
Reputation: 0

Joined: 28 Apr 2007
Posts: 3402

PostPosted: Sun Sep 07, 2008 9:20 pm    Post subject: Reply with quote

<?php
$string = fopen('C:\something.txt', r);
$output = explode('\n', $string, -1);
echo $output[0];
?>

outputs nothing.

_________________
Back to top
View user's profile Send private message MSN Messenger
ElectroFusion
Grandmaster Cheater
Reputation: 0

Joined: 17 Dec 2006
Posts: 786

PostPosted: Sun Sep 07, 2008 9:24 pm    Post subject: Reply with quote

Add me to msn and ill help you.

[email protected]

_________________
qwerty147 wrote:

ghostonline wrote:

what world are you in?

bera

but i live in NZ
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Mon Sep 08, 2008 4:57 pm    Post subject: Reply with quote

u have to use 'r'

add the quotes...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites