Hi ![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Neurons not functioning here !![Frown :( :(](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
I have an array that I fill with values inside a loop like this :
Now, what I'm trying to do is create a function that would output a value corresponding with the one present in its fist parameter.
It would be called like this :
My bet is that I have to retrieve the key index of the data to be tested. But I would like to know if it is possible to design a function that doesn't have to loop through the whole array again.
Thanks for the help !
Neurons not functioning here !
I have an array that I fill with values inside a loop like this :
Code:
while ($row = mysql_fetch_array($sql_result[1])) {
$GLOBALS["site_pages"]["BASEDIR"][] = ...;
$GLOBALS["site_pages"]["SUBDIR"][] = ...;
$GLOBALS["site_pages"]["FILENAME"][] = ...;
}
Now, what I'm trying to do is create a function that would output a value corresponding with the one present in its fist parameter.
It would be called like this :
Code:
test_function("filename.php", "SUBDIR"); // gets right subdir
test_function("some directory", "FILENAME"); // gets right filename
My bet is that I have to retrieve the key index of the data to be tested. But I would like to know if it is possible to design a function that doesn't have to loop through the whole array again.
Thanks for the help !