Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > it.comp.www.php > #21578 > unrolled thread
| Started by | condorex <condorbox@gmail.com> |
|---|---|
| First post | 2017-04-20 15:04 -0700 |
| Last post | 2017-04-21 08:05 +0000 |
| Articles | 3 — 3 participants |
Back to article view | Back to it.comp.www.php
modificare indici array multidimensionale condorex <condorbox@gmail.com> - 2017-04-20 15:04 -0700
Re: modificare indici array multidimensionale Leonardo Serni <lserni@gmail.com> - 2017-04-21 01:14 +0200
Re: modificare indici array multidimensionale g4b0 <g4b0@nospam.com> - 2017-04-21 08:05 +0000
| From | condorex <condorbox@gmail.com> |
|---|---|
| Date | 2017-04-20 15:04 -0700 |
| Subject | modificare indici array multidimensionale |
| Message-ID | <87f850ea-a5ad-43bf-a120-18c49a1a743f@googlegroups.com> |
Ciao
vorrei modificare gli indici questo array
Array
(
[0] => WP_Term Object
(
[term_id] => 51
[name] => inferno di dante
[slug] => inferno-di-dante
[term_group] => 0
[term_taxonomy_id] => 51
[taxonomy] => project_category
[description] =>
[parent] => 0
[count] => 1
[filter] => raw
)
[1] => WP_Term Object
(
[term_id] => 52
[name] => natura morta
[slug] => natura-morta
[term_group] => 0
[term_taxonomy_id] => 52
[taxonomy] => project_category
[description] =>
[parent] => 0
[count] => 1
[filter] => raw
)
[2] => WP_Term Object
(
[term_id] => 53
[name] => paesaggi
[slug] => paesaggi
[term_group] => 0
[term_taxonomy_id] => 53
[taxonomy] => project_category
[description] => Flash impressi nella memoria nell’immensità del paesaggio
[parent] => 0
[count] => 1
[filter] => raw
)
[3] => WP_Term Object
(
[term_id] => 54
[name] => porte
[slug] => porte
[term_group] => 0
[term_taxonomy_id] => 54
[taxonomy] => project_category
[description] =>
[parent] => 0
[count] => 1
[filter] => raw
)
)
cioè vorrei che ad esempio il contenuto di
[2] => WP_Term Object
mi passasse a
[0] => WP_Term Object
e
[3] => WP_Term Object
a
[1] => WP_Term Object
Spero di essermi spiegato
Grazie della collaborazione
[toc] | [next] | [standalone]
| From | Leonardo Serni <lserni@gmail.com> |
|---|---|
| Date | 2017-04-21 01:14 +0200 |
| Message-ID | <f4gifclmtfj2738ddao1j9phv2v6gplahq@L.Serni> |
| In reply to | #21578 |
On Thu, 20 Apr 2017 15:04:51 -0700 (PDT), condorex <condorbox@gmail.com>
wrote:
>Ciao
>vorrei modificare gli indici questo array
>cioè vorrei che ad esempio il contenuto di
>[2] => WP_Term Object
>mi passasse a
>[0] => WP_Term Object
>
$arr[0] = $arr[2]; unset($arr[2]);
$arr[1] = $arr[3]; unset($arr[3]);
Leonardo
--
A terrible beauty is born.
- W. B. Yeats, Easter 1916
[toc] | [prev] | [next] | [standalone]
| From | g4b0 <g4b0@nospam.com> |
|---|---|
| Date | 2017-04-21 08:05 +0000 |
| Message-ID | <odcego$1klt$1@gioia.aioe.org> |
| In reply to | #21579 |
Il Fri, 21 Apr 2017 01:14:51 +0200, Leonardo Serni ha scritto: > $arr[0] = $arr[2]; unset($arr[2]); > $arr[1] = $arr[3]; unset($arr[3]); Oppure se vuoi fare qualcosa di piú sofisticato puoi usare usort con una callback adatta. http://php.net/manual/en/function.usort.php g4b0
[toc] | [prev] | [standalone]
Back to top | Article view | it.comp.www.php
csiph-web