Hi,
I am working on making a OFFline message program for my users, to other users. They just enter the username of the person the message is to, the message subject, and the message, (sounds like e-mail huh).
The problems I have with it is this, When I go to call on these messages, how do I know how many are there, and how to assign them.
See the files will be saves like this.
FROM UserSUBJECTTimestamp*message
Each line is another message.
I use this same format for other areas, but I know how many variables there are, and I assign them each a different name, cause I dont really understand how to read ARRAYs in PHP.
The current code I use to read there files is this:
<?php
$fromuser=strtok($filedata[0],"");
$subject=strtok("");
$timestamp=strtok("");
$message=strtok("");
$n_field=strtok("");
//then move on to next line
$fromuser=strtok($filedata[1],"");
?>
This has worked well for me, cause I can name each variable and read the files. The only problem is, how can i use this for a UNKNOW amount of lines?
Then also when I call them:
<?php
echo $fromuser
?>
how can i get the from user from a specific array, as well as the other varialbles.
I am guessing its a look with a incrimental value. But I dont understand how to do this in PHP, and how to read the ARRAY, i am new to this syntacs.