|
Posted by windandwaves on 11/18/25 11:38
Hi Folk
I have the following array:
$m = array();
$m[0] = array("lodgings", "rooms");
$m[1] = array("location", "there and away");
$m[2] = array("functions", "events and groups");
$m[3] = array("activities", "things to do", "exclusive activities");
$m[4] = array("enquiries", "tariffs");
$m[5] = array("download", "media info");
If I have a string from the array, for example, download, and I want to find
out what number it occures in (i.e. 0 - 5, for download the answer being 5)
then how do I find out? I looked at the array functions, but I am not sure
what to use (arrays are new to me).
Also, I saw this function (which may actually help), what is the & doing on
the first line?
function array_set_current(&$array, $key){
reset($array);
while(current($array)){
if(key($array) == $key){
break;
}
next($array);
}
}
TIA
Nicolaas
Navigation:
[Reply to this message]
|