[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

SV: SV: [PROGRAMMERING] Rekursion i php



> Og så videre. Hvis man ikke benytter en rekursiv funktion til dette,
kan 
> man komme ud i nogle ret komplicerede koder.

Ja det har du ret i.. Personligt plejer jeg heller aldrig at arbejde med
arrays, men benytter hægtede lister i stedet. Det er "lettere"
forståeligt hvis man har mange data samlet i samme struktur. Ved dog
ikke præcist hvordan man gør det i PHP da det mig bekendt ikke er
objektorienteret som Java (det jeg normalt programmerer).

Har lige et sidste spg. hvis jeg ønsker at rette en titel ud for et
bestemt id eller far. Ex hvor far=5 && id=8.

Hvordan gør jeg så dette?
	$array[5][8]['titel']='Ny titel';

virker ikke som den skal. Så der er nok noget jeg stadig ikke helt har
forstået med de multidimensionale arrays.

Jeg er i stand til at finde den med en løkke
	foreach ($array[5] as $punkt){
	        if($punkt['id']==8) print $punkt['titel'];
	}
Men sætter jeg $punkt['titel']='Hej'; retter den ikke $array men kun den
midlertidige værdi...

Hilsen Jan




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:43 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *