Hi,
I have an array that I want to use in a number of pages so i wrote it in a file arrays.php then included this page on my other pages. I wrote the array then wrote a function to return it...
I was hoping to then just call the function from other pages to get the array...
... but it didn't work out that way! Where am I going wrong?
I have an array that I want to use in a number of pages so i wrote it in a file arrays.php then included this page on my other pages. I wrote the array then wrote a function to return it...
Code:
<?php
$fields = array ( 0=>"Accept",
1=>"Accept-Encoding",
2=>"Accept-Language",
3=>"Alert-Info",
4=>"Allow",
function getFields() {
return fields;
}
I was hoping to then just call the function from other pages to get the array...
Code:
$array = getFields();
... but it didn't work out that way! Where am I going wrong?