Getting vars from TXT 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
Perfidus
Forum Contributor
Posts: 114
Joined: Sun Nov 02, 2003 9:54 pm

Getting vars from TXT file

Post by Perfidus »

I have different TXT's with concatenated vars exactly like the example:
age=34&address=90&var3=77&var4&
I need to recover those variables and also their names, because I wont know the name of the vars in every TXT file, and they will be different, so I need to do a script that can read the vars and convert them to php vars without having any idea of what's is inside txt.
I thought that I can just read "fopen()" the whole txt and add the strings to an address, like :

txtdecoder.php?var1=34&var2=90&var3=77

But some txt are really huge to be send by url.

The final result I need is something like:

$recoveredvar1=age;
$recoveredvalue1=34;

$recoveredvar2=address;
$recoveredvalue2=90;

Any hints?
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

what you are trying to do is going to be very difficult probebly. you can probebly just use file_get_contents() then explode per & and u may have the end result you want but still this is a very bad way to go about getting and storing data, use a database
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

I wouldn't say it's that difficult.

If the file has defenite line breaks, use file(). The result will be an array that can be
iterated over and parsed as you go.

You could also use fread() after an fopen(). Concat what you read in to a string then parse that
string.

Check these functions at php.net. There are some good examples there on how to use these functions.

Cheers
Perfidus
Forum Contributor
Posts: 114
Joined: Sun Nov 02, 2003 9:54 pm

Post by Perfidus »

Shiznatix, I'm also using a database. This TXT strings are the output of an application.

BDKR I'm going to check out those functions, I do not think neither it's gonna be so difficult, but I needed a hint to start with, sometimes it help walking a long stupid way.

Thanks both of you!
User avatar
IceMetalPunk
Forum Commoner
Posts: 71
Joined: Thu Jul 07, 2005 11:45 am

Post by IceMetalPunk »

And another function you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :) is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents(&quote;myfile.txt&quote;);
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
$varnames&#1111;$i]=explode(&quote;=&quote;,$contents&#1111;$i])&#1111;0];
parse_string($contents&#1111;$explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents(&quote;myfile.txt&quote;);
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
$varnames&#1

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents(&quote;myfile.txt&quote;);
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
$varnames&#1111;$i]=explode(&quote;=&quote;,$co it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i&aon you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents(&quote;myfile.txt&quote;);
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
parse_string($contents&#1111;$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their von you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)uote;&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}

Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :) explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
pu can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents(&quote;myfile.txt&quote;e_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)t");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_s$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parsneed to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)p;quote;,$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parsed9]

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)1111;0];
parse_string($contents[$i]);
}

Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :));
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_stringuote;);
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}

Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)on you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)ut is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their vmp;quote;myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)bout is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contentsamp;quote;&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])&#111uote;);
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and using it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through g, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)ed to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])&#11on you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents(&quote;myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i&lt;count($contents); $i++) {
parse_string($contents&#1111;$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_strip;quote;);
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents(&quote;myfile.txt&quote;);
$contents=explode(&quote;&am. this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents(&quote;myfile.txt&quote;);
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
parse_string($contents&#1111;$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :tents("myfile.txt");
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
parse_string($contentsї$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)on you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can quote;myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you c$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

IceMetalPunk wrote:And another function you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)
Sweet!tion you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
se_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents(&quote;myfile.txt&quote;);
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
$varnames&#1111;$i]=explode(&quote;=&you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents&#1111;$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents(&quote;myfile.txt&quote;);
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
$varnames&#1111;$i]=explode(&quote;=&quote;,$contents&#1111;$i])&#1111;0];
explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&""IceMetalPunk"]And another function you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents(&quote;myfile.txt&quote;);
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
parse_string($contents&#1111;$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set wi"IceMetalPunk"]And another function you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quote]

Sweet!uote;);
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}

Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quote]

Sweet!1;$i]);
}

Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quote]

Sweet!rse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt&quote;);
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents(&quote;myfile.txt&quote;);
$contents=explode(&qu might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quote]

Sweet!get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (si {
parse_string($contents[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the nam"]And another function you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quote]

Sweet!plode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quotts[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quote]

Sweet!amp;quote;,$contents[$i])[0];
parse_string($contents[$i]);
}

Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quote]

Sweet!("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
amp;",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of thtents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}

Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quote]

Sweet!"IceMetalPunk"]And another function you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0ll set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quote]

Sweet!nction you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set wi76]$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quote]

Sweet!function you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_amp;quote;);
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=&amptents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their vhe variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($content); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}[/php:1:32ac1926s way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quote]

Sweet!And another function you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quote]

Sweet!111;$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt&quote;);
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=&am"IceMetalPunk"]And another function you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
parse_string($contents&#1111;$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (sincecontents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents(&quote;myfile.txt&quote;);
$contents=explode(&quote;&amp;&quote;,$conten to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents(&quote;myfile.txt&quote;);
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
parse_string($contents&#1111;$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quote]

Sweet32ac192676]$contents=file_get_contents(&quote;myfile.txt&quote;);
$contents=explode(&quote;&amp;&quote;,$contents);
for ($i=0; $i&lt;count($contents); $i++) {
parse_string($contentsї$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quote]

Sweet!"IceMetalPunk"]And another function you might need to know about is parse_string.... this way, once you explode the string, you can parse it. For example:

Code: Select all

$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}
That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
parse_string($contents[$i]);
}

That will set all the variables you get after exploding it. To get the names, I'd do this:

Code: Select all

$varnames=array();
$contents=file_get_contents("myfile.txt");
$contents=explode("&",$contents);
for ($i=0; $i<count($contents); $i++) {
$varnames[$i]=explode("=",$contents[$i])[0];
parse_string($contents[$i]);
}
Then you can look through $varnames to get the names of the variables, and use parse_string to get their values (since they were set with parse_string).

-IMP ;) :)[/quote]

Sweet!
Post Reply