<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[PHP] Sommare valori array by key]]></title><description><![CDATA[<p dir="auto">Ho un array così formato</p>
<pre><code class="language-php">Array
(
    [0] =&gt; Array
        (
            [name] =&gt; Prova
            [price] =&gt; 10
            [typology] =&gt; BOOKING
            [required] =&gt; 1
        )

    [1] =&gt; Array
        (
            [name] =&gt; Prova
            [price] =&gt; 10
            [typology] =&gt; BOOKING
            [required] =&gt; 1
        )

    [2] =&gt; Array
        (
            [name] =&gt; Prova
            [price] =&gt; 10
            [typology] =&gt; BOOKING
            [required] =&gt; 1
        )

    [3] =&gt; Array
        (
            [name] =&gt; Non è una prova
            [price] =&gt; 10
            [typology] =&gt; BOOKING
            [required] =&gt; 2
        )

    [4] =&gt; Array
        (
            [name] =&gt; Prova
            [price] =&gt; 10
            [typology] =&gt; BOOKING
            [required] =&gt; 1
        )


)
</code></pre>
<p dir="auto">e devo sommare tutti i valori 'price' degli array che hanno gli altri valori uguali.</p>
]]></description><link>https://dev.connect.gt/topic/117196/php-sommare-valori-array-by-key</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 09:10:35 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/117196.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 13 Dec 2009 11:18:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [PHP] Sommare valori array by key on Mon, 18 Jan 2010 15:28:58 GMT]]></title><description><![CDATA[<p dir="auto">up, leggete il primo post</p>
<p dir="auto">Devo sommare il 'price' di tutti i sotto-array che hanno TUTTI gli altri campi uguali</p>
]]></description><link>https://dev.connect.gt/post/878378</link><guid isPermaLink="true">https://dev.connect.gt/post/878378</guid><dc:creator><![CDATA[x3d0]]></dc:creator><pubDate>Mon, 18 Jan 2010 15:28:58 GMT</pubDate></item><item><title><![CDATA[Reply to [PHP] Sommare valori array by key on Sun, 13 Dec 2009 21:18:24 GMT]]></title><description><![CDATA[<p dir="auto">No, in quella discussione si fa un'altra cosa</p>
<pre><code class="language-php">$reductions[$roomInfo['id']][$treatmentInfo['treatment_type']][] =
array("treatment_type" =&gt;$treatmentInfo['treatment_type'],
"room_id" =&gt; $roomInfo['id'],
"name" =&gt; $reductionInfo['ReductionsType']['name'],
"price" =&gt; $this-&gt;PriceReduction($reductionInfo, $base_price),
"typology" =&gt; $reductionInfo['ReductionsType']['typology'],
"required" =&gt; $reductionInfo['ReductionsType']['required']);
</code></pre>
<p dir="auto">Questo è l'array. In pratica devo fare che ogni volta che eseguo questo codice l'indice "price" deve sommarsi con il precedente array che ha gli altri valori uguali.</p>
<p dir="auto">Invece di un =&gt; avrei bisogno di un +=&gt;</p>
]]></description><link>https://dev.connect.gt/post/878377</link><guid isPermaLink="true">https://dev.connect.gt/post/878377</guid><dc:creator><![CDATA[x3d0]]></dc:creator><pubDate>Sun, 13 Dec 2009 21:18:24 GMT</pubDate></item><item><title><![CDATA[Reply to [PHP] Sommare valori array by key on Sun, 13 Dec 2009 11:59:15 GMT]]></title><description><![CDATA[<p dir="auto">Ciao x3d0,</p>
<p dir="auto">qualche giorno fà è stata aperta una discusione sullo stesso argomento, la trovi qua:<br />
<a href="http://www.giorgiotave.it/forum/php-mysql/129924-combinare-due-array.html" rel="nofollow ugc">http://www.giorgiotave.it/forum/php-mysql/129924-combinare-due-array.html</a></p>
]]></description><link>https://dev.connect.gt/post/878376</link><guid isPermaLink="true">https://dev.connect.gt/post/878376</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Sun, 13 Dec 2009 11:59:15 GMT</pubDate></item></channel></rss>