Hi!
What you can do is define this array in global namespace in a separate file:
file mytable.php:
array("name1"=>"value1",
"name2"=>"value2");
and include it on every page.
But this has a number of problems:
- you won't use all the values on every page, so you will be wasting memory
- the list will grow and it will probably be larger than you think quite soon
The best way would be to use a database such as MySQL. This way you could query particular result sets and get only the data you need on a specific page, you could make an editing interface and edit the data through your browser.
If you don't have access to any database server and you want to have ability to modify data through the web browser, you could store records in tab-delimited format in a file. Then use file() function to get all records in an array and extract specific information from each line. You could also use fixed-length columns - this way you would extract information you need faster because all you would need would be to calculate column offset and extract a specific portion of a row using substr() function.
Or consider ini format because this way all ini functions are available in PHP 4.0 and above.
However, the best solution without a database server is to use a simple include file - it will load faster, it can be edited both through FTP and through a text editor at home. Although it will waste memory (all data is not needed on every page), I think it won't waste much of it - and if it completes fast enough and your server load is not in the vicinity of thousands of hits per minute, it'll live. :-)
If you need more help,I am glad to help,
Best regards,
Stas