|
Posted by Jerry Stuckle on 09/17/05 19:21
Patrick wrote:
> Hi All,
>
> Not sure if this is possible or not. How can I have a global constant as
> a part of my variable names. As an example, I want all the ZZZ to equal
> "C10" in the snippet of code below.
>
> Why do I want to do this you ask? We are going to have anywhere from 60
> to 100 drifters in the ocean sending back gps data and a table of that
> data will be on a webpage. I am going to have separate text files with
> PHP in them for includes to build the table. I thought rather than
> having to create each file and assign the unique variables throughout
> the file for each unit I could just tell it once that it is unit C10
> save the page and then change the global and save as the next unit name.
> I hope I didn't present this query in a confusing manner. Any help or
> ideas you can give me are greatly appreciated.
>
> Regards,
> Patrick
>
>
> $ZZZdataFile = "/DATA2/BUOY/ZZZdata.dat";
> if (!($fpZZZa = fopen($ZZZdataFile, "r")))
> exit("Unable to open $ZZZdataFile.");
> while (!feof($fpZZZa))
> {
> // Assign variables to optional arguments
> $buffer = fscanf($fpZZZa, "%s %s %s %s %s %s",
> $ZZZdate $ZZZtime, $ZZZlat, $ZZZlon);
> }
> fclose ($fpZZZa);
>
>
>
>
I'd use a databaswe instead.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|