FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Associative Array
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Associative Array [message #176143 is a reply to message #176142] Sat, 26 November 2011 00:55 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
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=blue]> => 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
[color=blue]> [colorepack] => 74#P_701_E[/color]
> [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
[color=blue]> [numero1] => [numero2] => => 39
> [tipo_stampa] => 4_1
> [il_colore0] => 1
> [il_colore1] => 1
> [il_colore2] => 1
> [ad_adornment] => Array
> (
> [0] => 11
> [1] => 13
> )
>
[color=blue]> [pacchetto_id] => 136#P_701 [colorepack] => 45#P_701_D[/color]
> [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(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Order/Timing of Execution of PHP
Next Topic: Browser doesn't support
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 08:42:58 GMT 2024

Total time taken to generate the page: 0.05244 seconds