Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #3938

Re: Associative Array

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: Associative Array
Date Fri, 25 Nov 2011 19:55:15 -0500
Organization A noiseless patient Spider
Lines 120
Message-ID <japdds$g99$1@dont-email.me> (permalink)
References <4ed034c2$0$1384$4fafbaef@reader1.news.tin.it>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Sat, 26 Nov 2011 00:55:24 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="0J9bC3jmtvLneyZKWAAHFA"; logging-data="16681"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8M5eZhBfnL55KFKFCv3mFVY23/WTwXVw="
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0
In-Reply-To <4ed034c2$0$1384$4fafbaef@reader1.news.tin.it>
Cancel-Lock sha1:GLilxnd6r1aSh+180DL8KK37IyU=
Xref x330-a1.tempe.blueboxinc.net comp.lang.php:3938

Show key headers only | View raw


On 11/25/2011 7:37 PM, Jesolo Sun wrote:
>
> I have variuous selectbox a inputbox radio e checkbox
> <INPUT id="99_300_prezzo0" name="product_data[99][300][prezzo0]"
> readOnly="readonly" type="text">
> <INPUT id="99_300_prezzo1" name="product_data[99][300][prezzo1]"
> readOnly="readonly" type="text">
> <INPUT id="99_300_prezzo2" name="product_data[99][300][prezzo2]"
> readOnly="readonly" type="text">
>
> Check this data from $_POST
> print_r ($_POST);
>
> and wtite :
> Array ( [product_data] =>
> Array ( [99] =>
> Array ( [300] =>
> Array ( [prezzo0] => 2.20
> [prezzo1] =>
> [prezzo2] =>
> [prezzocal0] => 238.03
> [prezzocal1] =>
> [prezzocal2] =>
> [numero0] => 108
> [numero1] =>
> [numero2] =>
> [color] => 64
> [tipo_stampa] => 4_0
> [il_colore0] => 1
> [il_colore1] => 1
> [il_colore2] => 1
> [adornment] =>
> Array ( [0] => 11 [1] => 12 )
> [pacchetto_id] => 136#P_701
> [colorepack] => 74#P_701_E
> [realization_period] => N ) ) ) [submit] => Conferma ordine )
>
>
>
> $array = $_POST;
>
> for ($i=0;$i<count($array)-1;$i++)
> {
>
> for ($a=$i+1;$a<count($array);$a++)
> {
> for ($b=$i+1;$b<count($array);$b++)
> {
>
> for ($c=$i+1;$c<count($array);$c++)
> {
> print $Colore = $_POST['color']."<br>";
> $ordina = strcmp($array[$i]["device"], $array[$c]["device"]);
> if ($ordina > 0)
> {
> $ordinato = $array[$i];
> $array[$i] = $array[$a];
> $array[$a] = $array[$b];
> $array[$b] = $array[$c];
> $array[$c] = $ordinato;
> }
> }
> }
> }
> }
>
> echo "<pre>\n";
> print_r($array);
> echo "</pre>\n";
>
>
> Array
> (
> [product_data] => Array
> (
> [99] => Array
> (
> [300] => Array
> (
> [prezzo0] => 2.22
> [prezzo1] => [prezzo2] => [prezzoAa0] => 239.26
> [prezzocal1] => [prezzocal2] => [numero0] => 108
> [numero1] => [numero2] => [color] => 39
> [tipo_stampa] => 4_1
> [il_colore0] => 1
> [il_colore1] => 1
> [il_colore2] => 1
> [ad_adornment] => Array
> (
> [0] => 11
> [1] => 13
> )
>
> [pacchetto_id] => 136#P_701 [colorepack] => 45#P_701_D
> [realization_period] => N
> )
>
> )
>
> )
>
> [submit] => Conferma ordine )
>
>
> 5 Array ...
> How do I recover my data to manage them?
>
>
>

I don't understand your problem.  Please forget the code and state it 
succinctly.  It will be much easier for us to help you.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Associative Array "Jesolo Sun" <gala@tiscali.it> - 2011-11-26 01:37 +0100
  Re: Associative Array Jerry Stuckle <jstucklex@attglobal.net> - 2011-11-25 19:55 -0500
    Re: Associative Array "Jesolo Sun" <gala@tiscali.it> - 2011-11-26 09:01 +0100
      Re: Associative Array Jerry Stuckle <jstucklex@attglobal.net> - 2011-11-26 05:01 -0500
      Re: Associative Array Norman Peelman <npeelmandog@cfl.rr.com> - 2011-11-26 07:55 -0500
        Re: Associative Array "Jesolo Sun" <gala@tiscali.it> - 2011-11-28 10:42 +0100
      Re: Associative Array Jerry Stuckle <jstucklex@attglobal.net> - 2011-11-26 10:28 -0500
        Re: Associative Array "Jesolo Sun" <gala@tiscali.it> - 2011-11-28 10:41 +0100
          Re: Associative Array Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com> - 2011-11-28 11:11 +0100
            Re: Associative Array "Jesolo Sun" <gala@tiscali.it> - 2011-11-28 11:33 +0100
              Re: Associative Array Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com> - 2011-11-28 12:08 +0100
              Re: Associative Array Jerry Stuckle <jstucklex@attglobal.net> - 2011-11-28 07:27 -0500
                Re: Associative Array Cristiano Larghi <c.larghi@criosoftware.it> - 2011-11-28 12:41 +0000
                Re: Associative Array "Jesolo Sun" <gala@tiscali.it> - 2011-11-28 14:48 +0100
                Re: Associative Array Jerry Stuckle <jstucklex@attglobal.net> - 2011-11-28 13:57 -0500
                Re: Associative Array Doug Miller <doug_at_milmacdotcom@example.com> - 2011-11-28 15:42 -0500
                Re: Associative Array Jerry Stuckle <jstucklex@attglobal.net> - 2011-11-28 16:00 -0500
                Re: Associative Array Doug Miller <doug_at_milmacdotcom@example.com> - 2011-11-28 18:26 -0500
                Re: Associative Array Jerry Stuckle <jstucklex@attglobal.net> - 2011-11-28 21:03 -0500
                Re: Associative Array "Jesolo Sun" <gala@tiscali.it> - 2011-11-28 14:31 +0100
                Re: Associative Array "Jesolo Sun" <gala@tiscali.it> - 2011-11-28 15:59 +0100
                Re: Associative Array Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com> - 2011-11-28 16:39 +0100

csiph-web