php_guest Posted July 8, 2010 Share Posted July 8, 2010 I have a list of countries and categories which are not in database. What is the best way to display them when I need them if I don't use object programming? Let's say I have 30 categories. $country_list = array( '1'=>"category1", '2'=>"category2", '3'=>"category3" ... ); Is the best way to create file lists.php and then I put into this file all lists? Than I require_once this file in every page. Or is better to create function show_lists($listsName) and store inside all lists? Link to comment https://forums.phpfreaks.com/topic/207157-the-best-way-to-display-list-of-countries-categories/ Share on other sites More sharing options...
AbraCadaver Posted July 8, 2010 Share Posted July 8, 2010 If it will never change then it doesn't really matter. If it will change infrequently then I would put it in an include file. If it changes frequently, and you don't have or want a database, I would store it in a plain text file that can be read and written to. Link to comment https://forums.phpfreaks.com/topic/207157-the-best-way-to-display-list-of-countries-categories/#findComment-1083162 Share on other sites More sharing options...
php_guest Posted July 8, 2010 Author Share Posted July 8, 2010 I decided to put it in functions.php. But is it ok to have all functions in functions.php? Does it make any slower if you include in each page functions.php where you have all functions? Or it doesn't effect since I don't call all those functions but only 1? thank you Link to comment https://forums.phpfreaks.com/topic/207157-the-best-way-to-display-list-of-countries-categories/#findComment-1083170 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.