PDA

View Full Version : variables Vs Text file menu


scroots
05-28-2003, 09:15 PM
Currently i have a script that gets info from text files and builds a menu. For my menu would it be better to dodge using text files and mount the info in variables in my php script.

which is more taxing on a server? a script that reads and outputs lines from textfiles or a slightly larger php script that has the stuff to putput in it?

scroots

optimism_
05-28-2003, 10:11 PM
surely common sense would say the file method is more taxing, since there are more function calls to read the data and no benefit in memory usage because the file contents would be stored in memory anyway.

mordred
05-28-2003, 10:37 PM
File reading usually takes up some time, so directly storing the information in PHP information lets you save this execution time. But is it worth it? Controlling the output of a script by using a text file as a configuration file is really easy to maintain, even non-PHPers can tinker with it.

scroots
05-29-2003, 06:14 PM
I may recode and try it out.

scroots