Page 1 sur 1

ARRAY

Posté : 06 nov. 2015, 15:31
par pipoulito
Bonjour,

Travaillant sous Wordpress, j'aurais besoin de traduire ce genre de code de retour :

Code : Tout sélectionner

Array ( [0] => Array ( [title] => tt1 [layout] => d [limit] => [one_column] => 1 [top_layout] => 0 [top_limit] => 1 [cat] => Array ( [0] => 12 ) [tag] => [time] => 0 [order] => rand [manual] => [action] => slider [pagination] => infinite-scroll [action_link_text] => View all [action_link_url] => http:// [autoplay] => [type] => posts ) [1] => Array ( [title] =>tt2 [layout] => d [limit] => [one_column] => 1 [top_layout] => 0 [top_limit] => 2 [cat] => Array ( [0] => 11 ) [tag] => [time] => 0 [order] => date [manual] => [action] => slider [pagination] => numeric [action_link_text] => View all [action_link_url] => http:// [autoplay] => [type] => posts ) [2] => Array ( [title] => tt2 [layout] => d [limit] => [one_column] => 1 [top_layout] => 0 [top_limit] => 2 [cat] => Array ( [0] => 13 ) [tag] => [time] => 0 [order] => rand [manual] => [action] => slider [pagination] => infinite-scroll [action_link_text] => View all [action_link_url] => http:// [autoplay] => [type] => posts ) [3] => Array ( [title] => tt2 [layout] => d [limit] => [one_column] => 1 [top_layout] => 0 [top_limit] => 2 [cat] => Array ( [0] => 128 ) [tag] => [time] => 0 [order] => date [manual] => [action] => slider [pagination] => load-more [action_link_text] => View all [action_link_url] => http:// [autoplay] => [type] => posts ) )

dans une déclaration de tableau PHP, dans ce style :

Code : Tout sélectionner

$fruits = array ( "fruits" => array("a" => "orange", "b" => "banana", "c" => "apple"), "numbers" => array(1, 2, 3, 4, 5, 6), "holes" => array("first", 5 => "second", "third") )
;

Pourriez-vous m'aider car je ne comprends pas l'arborescence du ARRAY qui m'est retourné
merci d'avance.

Re: ARRAY

Posté : 06 nov. 2015, 16:42
par or 1
voir si l'affichage dans le code source de la page plutôt que directement dans le navigateur, n'a pas un formatage qui rend le tout bien plus compréhensible.

Re: ARRAY

Posté : 06 nov. 2015, 18:09
par @rthur
Indenté proprement, ça donne juste un tableau classique qui contient lui même des tableaux :
Array ( 
	[0] => Array (
		[title] => tt1 
		[layout] => d 
		[limit] => 
		[one_column] => 1 
		[top_layout] => 0 
		[top_limit] => 1 
		[cat] => Array ( 
			[0] => 12
		) 
		[tag] => 
		[time] => 0 
		[order] => rand 
		[manual] => 
		[action] => slider 
		[pagination] => infinite-scroll 
		[action_link_text] => View all 
		[action_link_url] => http:// 
		[autoplay] => 
		[type] => posts
	) 
	[1] => Array ( 
		[title] =>tt2 
		[layout] => d 
		[limit] => 
		[one_column] => 1 
		[top_layout] => 0 
		[top_limit] => 2 
		[cat] => Array ( 
			[0] => 11
		) 
		[tag] => 
		[time] => 0 
		[order] => date 
		[manual] => 
		[action] => slider 
		[pagination] => numeric 
		[action_link_text] => View all 
		[action_link_url] => http:// 
		[autoplay] => 
		[type] => posts
	) 
	[2] => Array ( 
		[title] => tt2 
		[layout] => d 
		[limit] => 
		[one_column] => 1 
		[top_layout] => 0 
		[top_limit] => 2 
		[cat] => Array ( 
			[0] => 13
		) 
		[tag] => 
		[time] => 0 
		[order] => rand 
		[manual] => 
		[action] => slider 
		[pagination] => infinite-scroll 
		[action_link_text] => View all 
		[action_link_url] => http:// 
		[autoplay] => 
		[type] => posts
	) 
	[3] => Array ( 
		[title] => tt2 
		[layout] => d 
		[limit] => 
		[one_column] => 1 
		[top_layout] => 0 
		[top_limit] => 2 
		[cat] => Array ( 
			[0] => 128
		) 
		[tag] => 
		[time] => 0 
		[order] => date 
		[manual] => 
		[action] => slider 
		[pagination] => load-more 
		[action_link_text] => View all 
		[action_link_url] => http:// 
		[autoplay] => 
		[type] => posts
	)
)

Re: ARRAY

Posté : 06 nov. 2015, 18:25
par pipoulito
génial , merci !!