Function-returning array { OR } declare array at top of functions file?
| From: | Michael Hulse | Date: | Tue, 21 Mar 2006 22:35:05 +0000 |
| Subject: | Function-returning array { OR } declare array at top of functions file? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-232368@lists.php.net to get a copy of this message | ||
Hi,
I just wanted to know if it is wrong, or non-standard, for me to set-up functions that just return an array... example:
//////// function vert_links_array():
function vert_links_array() {
return array(
'1' => array(S_MANCOM,'start.php?page=products&sub=mancom',S_MANCOM_TI,'mancom'),
'2' => array(S_BRACLU,'start.php?page=products&sub=braclu',S_BRACLU_TI,'braclu'),
'3' => array(S_BRASHO,'start.php?page=products&sub=brasho',S_BRASHO_TI,'brasho'),
'4' => array(S_CALDIS,'start.php?page=products&sub=caldis',S_CALDIS_TI,'caldis'),
'5' => array(S_CUSMAN,'start.php?page=products&sub=cusman',S_CUSMAN_TI,'cusman'),
'6' => array(S_FRIDIS,'start.php?page=products&sub=fridis',S_FRIDIS_TI,'fridis'),
'7' => array(S_GOVMIL,'start.php?page=products&sub=govmil',S_GOVMIL_TI,'govmil'),
'8' => array(S_INDBRA,'start.php?page=products&sub=indbra',S_INDBRA_TI,'indbra'),
'9' => array(S_INDLIN,'start.php?page=products&sub=indlin',S_INDLIN_TI,'indlin'),
'10' => array(S_RAICAR,'start.php?page=products&sub=raicar',S_RAICAR_TI,'raicar'),
'11' => array(S_SAWGUI,'start.php?page=products&sub=sawgui',S_SAWGUI_TI,'sawgui'),
'12' => array(S_ASSPRO,'start.php?page=products&sub=asspro',S_ASSPRO_TI,'asspro')
); // Add more here.
}
OR
Should I just put the above array at the top of my functions file and access it as a global within other functions?
Any suggestions? I am a self-taught php dude, so please don't laugh if this is a silly question.
Thanks. :)
Cheers,
Micky