Jump to content

Recommended Posts

I'm trying to get my head around arrays (been trying for years and i'm still none the wiser!). Take a look at the code below. I'm basically trying to gather together six lots of information into an array, sort it into numerical order and then display it.

 

It's working to an extent, i've put the output below the code. You can see by the last line that the numerical values are in order, which is what I want. I just don't want it to look like that!

 

$TOTALS = array($TOTAL_REDUCED_1, $TOTAL_REDUCED_2, $TOTAL_REDUCED_3, $TOTAL_REDUCED_4, $TOTAL_REDUCED_5, $TOTAL_REDUCED_6);
natsort($TOTALS);
print_r($TOTALS);

 

Array ( [4] => [5] => [3] => [2] => [1] => [0] => 2,984.15 )

Array ( [4] => [5] => [3] => [2] => [0] => 2,984.15 [1] => 3,119.39 )

Array ( [5] => [4] => [3] => [0] => 2,984.15 [1] => 3,119.39 [2] => 3,176.89 )

Array ( [5] => [4] => [0] => 2,984.15 [1] => 3,119.39 [2] => 3,176.89 [3] => 3,278.73 )

Array ( [5] => [0] => 2,984.15 [1] => 3,119.39 [2] => 3,176.89 [3] => 3,278.73 [4] => 3,477.37 )

Array ( [0] => 2,984.15 [5] => 3,022.03 [1] => 3,119.39 [2] => 3,176.89 [3] => 3,278.73 [4] => 3,477.37 )

Link to comment
https://forums.phpfreaks.com/topic/68998-arrays-grrrr/
Share on other sites

//====== This bit repeats six times to create six different calculations=========
if ($supplier_name == "One") {

$ISDN2_REDUCED = $isdn2_line_details * $isdn2f * 12;
$ISDN_THIRTY_REDUCED = $isdn30_channels_line_details * $isdn30f * 12;
$ANALOGUE_LINES_REDUCED = $analogue_lines_line_details * $analogue_linesf * 12;
$LOCAL_REDUCED = $local_line_details * $localf / 100;
$NATIONAL_REDUCED = $national_line_details * $nationalf / 100;
$VODAFONE_REDUCED = $vodafone_line_details * $vodafonef / 100;
$ORANGE_REDUCED = $orange_line_details * $orangef / 100;
$TMOBILE_REDUCED = $tmobile_line_details * $tmobilef / 100;
$O2_REDUCED = $o2_line_details * $o2f / 100;
$INTERNATIONAL_REDUCED = $international_line_details * $internationalf / 100;
$OTHER_REDUCED = $other_line_details * $other_mobilef / 100;

$TOTAL_REDUCED_6 = $OTHER_REDUCED + $INTERNATIONAL_REDUCED + $VODAFONE_REDUCED + $ORANGE_REDUCED + $TMOBILE_REDUCED + $O2_REDUCED + $NATIONAL_REDUCED + $LOCAL_REDUCED + $ANALOGUE_LINES_REDUCED + $ISDN_THIRTY_REDUCED + $ISDN2_REDUCED;
$TOTAL_REDUCED_6 = number_format($TOTAL_REDUCED_6, 2);
}
//=====================

$TOTALS = array($TOTAL_REDUCED_1, $TOTAL_REDUCED_2, $TOTAL_REDUCED_3, $TOTAL_REDUCED_4, $TOTAL_REDUCED_5, $TOTAL_REDUCED_6);
natsort($TOTALS);
print_r($TOTALS);

Link to comment
https://forums.phpfreaks.com/topic/68998-arrays-grrrr/#findComment-346822
Share on other sites

The code below is repeated six times with the difference being the last two lines are called $TOTAL_REDUCED_1, $TOTAL_REDUCED_2, etc. to give six different calculations. I didn't copy and paste it all as it's rather a lot of code!

 

if ($supplier_name == "One") {

$ISDN2_REDUCED = $isdn2_line_details * $isdn2f * 12;
$ISDN_THIRTY_REDUCED = $isdn30_channels_line_details * $isdn30f * 12;
$ANALOGUE_LINES_REDUCED = $analogue_lines_line_details * $analogue_linesf * 12;
$LOCAL_REDUCED = $local_line_details * $localf / 100;
$NATIONAL_REDUCED = $national_line_details * $nationalf / 100;
$VODAFONE_REDUCED = $vodafone_line_details * $vodafonef / 100;
$ORANGE_REDUCED = $orange_line_details * $orangef / 100;
$TMOBILE_REDUCED = $tmobile_line_details * $tmobilef / 100;
$O2_REDUCED = $o2_line_details * $o2f / 100;
$INTERNATIONAL_REDUCED = $international_line_details * $internationalf / 100;
$OTHER_REDUCED = $other_line_details * $other_mobilef / 100;

$TOTAL_REDUCED_6 = $OTHER_REDUCED + $INTERNATIONAL_REDUCED + $VODAFONE_REDUCED + $ORANGE_REDUCED + $TMOBILE_REDUCED + $O2_REDUCED + $NATIONAL_REDUCED + $LOCAL_REDUCED + $ANALOGUE_LINES_REDUCED + $ISDN_THIRTY_REDUCED + $ISDN2_REDUCED;
$TOTAL_REDUCED_6 = number_format($TOTAL_REDUCED_6, 2);
}

Link to comment
https://forums.phpfreaks.com/topic/68998-arrays-grrrr/#findComment-346826
Share on other sites

Ok well i'm useless with arrays so I could maybe have worked out each of the $TOTAL_REDUCED figures using an array had I known how to!

 

After the six sections where it works out the $TOTAL_REDUCED amounts I need an array to sort the amounts into order and then display them, preferably in rows. The first row needs to be the lowest amount and go through to the last row displaying the highest amount. As you can see from my first post I seem to have got some sort of array to sort the items into order but the output looked horrible and I don't know why! I've never been able to grasp arrays so if my coding is completely wrong it wouldn't surprise me in the slightest!

Link to comment
https://forums.phpfreaks.com/topic/68998-arrays-grrrr/#findComment-346831
Share on other sites

Output is as follows:

 

Array ( [4] => [5] => [3] => [2] => [1] => [0] => 2,984.15 )
Array ( [4] => [5] => [3] => [2] => [0] => 2,984.15 [1] => 3,119.39 )
Array ( [5] => [4] => [3] => [0] => 2,984.15 [1] => 3,119.39 [2] => 3,176.89 ) 
Array ( [5] => [4] => [0] => 2,984.15 [1] => 3,119.39 [2] => 3,176.89 [3] => 3,278.73 )
Array ( [5] => [0] => 2,984.15 [1] => 3,119.39 [2] => 3,176.89 [3] => 3,278.73 [4] => 3,477.37 )
Array ( [0] => 2,984.15 [5] => 3,022.03 [1] => 3,119.39 [2] => 3,176.89 [3] => 3,278.73 [4] => 3,477.37 )

Link to comment
https://forums.phpfreaks.com/topic/68998-arrays-grrrr/#findComment-346838
Share on other sites

Here it is in its entirity! (told you there was a lot!) :-)

 

if ($supplier_name == "One") {

$ISDN2_REDUCED = $isdn2_line_details * $isdn2a * 12;
$ISDN_THIRTY_REDUCED = $isdn30_channels_line_details * $isdn30a * 12;
$ANALOGUE_LINES_REDUCED = $analogue_lines_line_details * $analogue_linesa * 12;
$LOCAL_REDUCED = $local_line_details * $locala / 100;
$NATIONAL_REDUCED = $national_line_details * $nationala / 100;
$VODAFONE_REDUCED = $vodafone_line_details * $vodafonea / 100;
$ORANGE_REDUCED = $orange_line_details * $orangea / 100;
$TMOBILE_REDUCED = $tmobile_line_details * $tmobilea / 100;
$O2_REDUCED = $o2_line_details * $o2a / 100;
$INTERNATIONAL_REDUCED = $international_line_details * $internationala / 100;
$OTHER_REDUCED = $other_line_details * $other_mobilea / 100;

$TOTAL_REDUCED_1 = $OTHER_REDUCED + $INTERNATIONAL_REDUCED + $VODAFONE_REDUCED + $ORANGE_REDUCED + $TMOBILE_REDUCED + $O2_REDUCED + $NATIONAL_REDUCED + $LOCAL_REDUCED + $ANALOGUE_LINES_REDUCED + $ISDN_THIRTY_REDUCED + $ISDN2_REDUCED;
$TOTAL_REDUCED_1 = number_format($TOTAL_REDUCED_1, 2);
}

if ($supplier_name == "Two") {

$ISDN2_REDUCED = $isdn2_line_details * $isdn2b * 12;
$ISDN_THIRTY_REDUCED = $isdn30_channels_line_details * $isdn30b * 12;
$ANALOGUE_LINES_REDUCED = $analogue_lines_line_details * $analogue_linesb * 12;
$LOCAL_REDUCED = $local_line_details * $localb / 100;
$NATIONAL_REDUCED = $national_line_details * $nationalb / 100;
$VODAFONE_REDUCED = $vodafone_line_details * $vodafoneb / 100;
$ORANGE_REDUCED = $orange_line_details * $orangeb / 100;
$TMOBILE_REDUCED = $tmobile_line_details * $tmobileb / 100;
$O2_REDUCED = $o2_line_details * $o2b / 100;
$INTERNATIONAL_REDUCED = $international_line_details * $internationalb / 100;
$OTHER_REDUCED = $other_line_details * $other_mobileb / 100;

$TOTAL_REDUCED_2 = $OTHER_REDUCED + $INTERNATIONAL_REDUCED + $VODAFONE_REDUCED + $ORANGE_REDUCED + $TMOBILE_REDUCED + $O2_REDUCED + $NATIONAL_REDUCED + $LOCAL_REDUCED + $ANALOGUE_LINES_REDUCED + $ISDN_THIRTY_REDUCED + $ISDN2_REDUCED;
$TOTAL_REDUCED_2 = number_format($TOTAL_REDUCED_2, 2);
}

if ($supplier_name == "Three") {

$ISDN2_REDUCED = $isdn2_line_details * $isdn2c * 12;
$ISDN_THIRTY_REDUCED = $isdn30_channels_line_details * $isdn30c * 12;
$ANALOGUE_LINES_REDUCED = $analogue_lines_line_details * $analogue_linesc * 12;
$LOCAL_REDUCED = $local_line_details * $localc / 100;
$NATIONAL_REDUCED = $national_line_details * $nationalc / 100;
$VODAFONE_REDUCED = $vodafone_line_details * $vodafonec / 100;
$ORANGE_REDUCED = $orange_line_details * $orangec / 100;
$TMOBILE_REDUCED = $tmobile_line_details * $tmobilec / 100;
$O2_REDUCED = $o2_line_details * $o2c / 100;
$INTERNATIONAL_REDUCED = $international_line_details * $internationalc / 100;
$OTHER_REDUCED = $other_line_details * $other_mobilec / 100;

$TOTAL_REDUCED_3 = $OTHER_REDUCED + $INTERNATIONAL_REDUCED + $VODAFONE_REDUCED + $ORANGE_REDUCED + $TMOBILE_REDUCED + $O2_REDUCED + $NATIONAL_REDUCED + $LOCAL_REDUCED + $ANALOGUE_LINES_REDUCED + $ISDN_THIRTY_REDUCED + $ISDN2_REDUCED;
$TOTAL_REDUCED_3 = number_format($TOTAL_REDUCED_3, 2);
}

if ($supplier_name == "Four") {

$ISDN2_REDUCED = $isdn2_line_details * $isdn2d * 12;
$ISDN_THIRTY_REDUCED = $isdn30_channels_line_details * $isdn30d * 12;
$ANALOGUE_LINES_REDUCED = $analogue_lines_line_details * $analogue_linesd * 12;
$LOCAL_REDUCED = $local_line_details * $locald / 100;
$NATIONAL_REDUCED = $national_line_details * $nationald / 100;
$VODAFONE_REDUCED = $vodafone_line_details * $vodafoned / 100;
$ORANGE_REDUCED = $orange_line_details * $oranged / 100;
$TMOBILE_REDUCED = $tmobile_line_details * $tmobiled / 100;
$O2_REDUCED = $o2_line_details * $o2d / 100;
$INTERNATIONAL_REDUCED = $international_line_details * $internationald / 100;
$OTHER_REDUCED = $other_line_details * $other_mobiled / 100;

$TOTAL_REDUCED_4 = $OTHER_REDUCED + $INTERNATIONAL_REDUCED + $VODAFONE_REDUCED + $ORANGE_REDUCED + $TMOBILE_REDUCED + $O2_REDUCED + $NATIONAL_REDUCED + $LOCAL_REDUCED + $ANALOGUE_LINES_REDUCED + $ISDN_THIRTY_REDUCED + $ISDN2_REDUCED;
$TOTAL_REDUCED_4 = number_format($TOTAL_REDUCED_4, 2);
}

if ($supplier_name == "Five") {

$ISDN2_REDUCED = $isdn2_line_details * $isdn2e * 12;
$ISDN_THIRTY_REDUCED = $isdn30_channels_line_details * $isdn30e * 12;
$ANALOGUE_LINES_REDUCED = $analogue_lines_line_details * $analogue_linese * 12;
$LOCAL_REDUCED = $local_line_details * $locale / 100;
$NATIONAL_REDUCED = $national_line_details * $nationale / 100;
$VODAFONE_REDUCED = $vodafone_line_details * $vodafonee / 100;
$ORANGE_REDUCED = $orange_line_details * $orangee / 100;
$TMOBILE_REDUCED = $tmobile_line_details * $tmobilee / 100;
$O2_REDUCED = $o2_line_details * $o2e / 100;
$INTERNATIONAL_REDUCED = $international_line_details * $internationale / 100;
$OTHER_REDUCED = $other_line_details * $other_mobilee / 100;

$TOTAL_REDUCED_5 = $OTHER_REDUCED + $INTERNATIONAL_REDUCED + $VODAFONE_REDUCED + $ORANGE_REDUCED + $TMOBILE_REDUCED + $O2_REDUCED + $NATIONAL_REDUCED + $LOCAL_REDUCED + $ANALOGUE_LINES_REDUCED + $ISDN_THIRTY_REDUCED + $ISDN2_REDUCED;
$TOTAL_REDUCED_5 = number_format($TOTAL_REDUCED_5, 2);
}

if ($supplier_name == "Sixl") {

$ISDN2_REDUCED = $isdn2_line_details * $isdn2f * 12;
$ISDN_THIRTY_REDUCED = $isdn30_channels_line_details * $isdn30f * 12;
$ANALOGUE_LINES_REDUCED = $analogue_lines_line_details * $analogue_linesf * 12;
$LOCAL_REDUCED = $local_line_details * $localf / 100;
$NATIONAL_REDUCED = $national_line_details * $nationalf / 100;
$VODAFONE_REDUCED = $vodafone_line_details * $vodafonef / 100;
$ORANGE_REDUCED = $orange_line_details * $orangef / 100;
$TMOBILE_REDUCED = $tmobile_line_details * $tmobilef / 100;
$O2_REDUCED = $o2_line_details * $o2f / 100;
$INTERNATIONAL_REDUCED = $international_line_details * $internationalf / 100;
$OTHER_REDUCED = $other_line_details * $other_mobilef / 100;

$TOTAL_REDUCED_6 = $OTHER_REDUCED + $INTERNATIONAL_REDUCED + $VODAFONE_REDUCED + $ORANGE_REDUCED + $TMOBILE_REDUCED + $O2_REDUCED + $NATIONAL_REDUCED + $LOCAL_REDUCED + $ANALOGUE_LINES_REDUCED + $ISDN_THIRTY_REDUCED + $ISDN2_REDUCED;
$TOTAL_REDUCED_6 = number_format($TOTAL_REDUCED_6, 2);
}

$TOTALS = array($TOTAL_REDUCED_1, $TOTAL_REDUCED_2, $TOTAL_REDUCED_3, $TOTAL_REDUCED_4, $TOTAL_REDUCED_5, $TOTAL_REDUCED_6);

print_r($TOTALS[0][0]); 
print_r($TOTALS[0][1]); 
print_r($TOTALS[0][2]); 
print_r($TOTALS[0][3]); 
print_r($TOTALS[0][4]); 
print_r($TOTALS[0][5]);

Link to comment
https://forums.phpfreaks.com/topic/68998-arrays-grrrr/#findComment-346921
Share on other sites

thats nothing :P my development teams have pages over 1000 lines. easily.

anyway,

 

1. what is $supplier_name.

2. try this...

 

if ($supplier_name == "One") {

$ISDN2_REDUCED = $isdn2_line_details * $isdn2a * 12;
$ISDN_THIRTY_REDUCED = $isdn30_channels_line_details * $isdn30a * 12;
$ANALOGUE_LINES_REDUCED = $analogue_lines_line_details * $analogue_linesa * 12;
$LOCAL_REDUCED = $local_line_details * $locala / 100;
$NATIONAL_REDUCED = $national_line_details * $nationala / 100;
$VODAFONE_REDUCED = $vodafone_line_details * $vodafonea / 100;
$ORANGE_REDUCED = $orange_line_details * $orangea / 100;
$TMOBILE_REDUCED = $tmobile_line_details * $tmobilea / 100;
$O2_REDUCED = $o2_line_details * $o2a / 100;
$INTERNATIONAL_REDUCED = $international_line_details * $internationala / 100;
$OTHER_REDUCED = $other_line_details * $other_mobilea / 100;

$TOTAL_REDUCED_1 = $OTHER_REDUCED + $INTERNATIONAL_REDUCED + $VODAFONE_REDUCED + $ORANGE_REDUCED + $TMOBILE_REDUCED + $O2_REDUCED + $NATIONAL_REDUCED + $LOCAL_REDUCED + $ANALOGUE_LINES_REDUCED + $ISDN_THIRTY_REDUCED + $ISDN2_REDUCED;
$TOTAL_REDUCED_1 = number_format($TOTAL_REDUCED_1);
}

if ($supplier_name == "Two") {

$ISDN2_REDUCED = $isdn2_line_details * $isdn2b * 12;
$ISDN_THIRTY_REDUCED = $isdn30_channels_line_details * $isdn30b * 12;
$ANALOGUE_LINES_REDUCED = $analogue_lines_line_details * $analogue_linesb * 12;
$LOCAL_REDUCED = $local_line_details * $localb / 100;
$NATIONAL_REDUCED = $national_line_details * $nationalb / 100;
$VODAFONE_REDUCED = $vodafone_line_details * $vodafoneb / 100;
$ORANGE_REDUCED = $orange_line_details * $orangeb / 100;
$TMOBILE_REDUCED = $tmobile_line_details * $tmobileb / 100;
$O2_REDUCED = $o2_line_details * $o2b / 100;
$INTERNATIONAL_REDUCED = $international_line_details * $internationalb / 100;
$OTHER_REDUCED = $other_line_details * $other_mobileb / 100;

$TOTAL_REDUCED_2 = $OTHER_REDUCED + $INTERNATIONAL_REDUCED + $VODAFONE_REDUCED + $ORANGE_REDUCED + $TMOBILE_REDUCED + $O2_REDUCED + $NATIONAL_REDUCED + $LOCAL_REDUCED + $ANALOGUE_LINES_REDUCED + $ISDN_THIRTY_REDUCED + $ISDN2_REDUCED;
$TOTAL_REDUCED_2 = number_format($TOTAL_REDUCED_2);
}

if ($supplier_name == "Three") {

$ISDN2_REDUCED = $isdn2_line_details * $isdn2c * 12;
$ISDN_THIRTY_REDUCED = $isdn30_channels_line_details * $isdn30c * 12;
$ANALOGUE_LINES_REDUCED = $analogue_lines_line_details * $analogue_linesc * 12;
$LOCAL_REDUCED = $local_line_details * $localc / 100;
$NATIONAL_REDUCED = $national_line_details * $nationalc / 100;
$VODAFONE_REDUCED = $vodafone_line_details * $vodafonec / 100;
$ORANGE_REDUCED = $orange_line_details * $orangec / 100;
$TMOBILE_REDUCED = $tmobile_line_details * $tmobilec / 100;
$O2_REDUCED = $o2_line_details * $o2c / 100;
$INTERNATIONAL_REDUCED = $international_line_details * $internationalc / 100;
$OTHER_REDUCED = $other_line_details * $other_mobilec / 100;

$TOTAL_REDUCED_3 = $OTHER_REDUCED + $INTERNATIONAL_REDUCED + $VODAFONE_REDUCED + $ORANGE_REDUCED + $TMOBILE_REDUCED + $O2_REDUCED + $NATIONAL_REDUCED + $LOCAL_REDUCED + $ANALOGUE_LINES_REDUCED + $ISDN_THIRTY_REDUCED + $ISDN2_REDUCED;
$TOTAL_REDUCED_3 = number_format($TOTAL_REDUCED_3);
}

if ($supplier_name == "Four") {

$ISDN2_REDUCED = $isdn2_line_details * $isdn2d * 12;
$ISDN_THIRTY_REDUCED = $isdn30_channels_line_details * $isdn30d * 12;
$ANALOGUE_LINES_REDUCED = $analogue_lines_line_details * $analogue_linesd * 12;
$LOCAL_REDUCED = $local_line_details * $locald / 100;
$NATIONAL_REDUCED = $national_line_details * $nationald / 100;
$VODAFONE_REDUCED = $vodafone_line_details * $vodafoned / 100;
$ORANGE_REDUCED = $orange_line_details * $oranged / 100;
$TMOBILE_REDUCED = $tmobile_line_details * $tmobiled / 100;
$O2_REDUCED = $o2_line_details * $o2d / 100;
$INTERNATIONAL_REDUCED = $international_line_details * $internationald / 100;
$OTHER_REDUCED = $other_line_details * $other_mobiled / 100;

$TOTAL_REDUCED_4 = $OTHER_REDUCED + $INTERNATIONAL_REDUCED + $VODAFONE_REDUCED + $ORANGE_REDUCED + $TMOBILE_REDUCED + $O2_REDUCED + $NATIONAL_REDUCED + $LOCAL_REDUCED + $ANALOGUE_LINES_REDUCED + $ISDN_THIRTY_REDUCED + $ISDN2_REDUCED;
$TOTAL_REDUCED_4 = number_format($TOTAL_REDUCED_4);
}

if ($supplier_name == "Five") {

$ISDN2_REDUCED = $isdn2_line_details * $isdn2e * 12;
$ISDN_THIRTY_REDUCED = $isdn30_channels_line_details * $isdn30e * 12;
$ANALOGUE_LINES_REDUCED = $analogue_lines_line_details * $analogue_linese * 12;
$LOCAL_REDUCED = $local_line_details * $locale / 100;
$NATIONAL_REDUCED = $national_line_details * $nationale / 100;
$VODAFONE_REDUCED = $vodafone_line_details * $vodafonee / 100;
$ORANGE_REDUCED = $orange_line_details * $orangee / 100;
$TMOBILE_REDUCED = $tmobile_line_details * $tmobilee / 100;
$O2_REDUCED = $o2_line_details * $o2e / 100;
$INTERNATIONAL_REDUCED = $international_line_details * $internationale / 100;
$OTHER_REDUCED = $other_line_details * $other_mobilee / 100;

$TOTAL_REDUCED_5 = $OTHER_REDUCED + $INTERNATIONAL_REDUCED + $VODAFONE_REDUCED + $ORANGE_REDUCED + $TMOBILE_REDUCED + $O2_REDUCED + $NATIONAL_REDUCED + $LOCAL_REDUCED + $ANALOGUE_LINES_REDUCED + $ISDN_THIRTY_REDUCED + $ISDN2_REDUCED;
$TOTAL_REDUCED_5 = number_format($TOTAL_REDUCED_5);
}

if ($supplier_name == "Sixl") {

$ISDN2_REDUCED = $isdn2_line_details * $isdn2f * 12;
$ISDN_THIRTY_REDUCED = $isdn30_channels_line_details * $isdn30f * 12;
$ANALOGUE_LINES_REDUCED = $analogue_lines_line_details * $analogue_linesf * 12;
$LOCAL_REDUCED = $local_line_details * $localf / 100;
$NATIONAL_REDUCED = $national_line_details * $nationalf / 100;
$VODAFONE_REDUCED = $vodafone_line_details * $vodafonef / 100;
$ORANGE_REDUCED = $orange_line_details * $orangef / 100;
$TMOBILE_REDUCED = $tmobile_line_details * $tmobilef / 100;
$O2_REDUCED = $o2_line_details * $o2f / 100;
$INTERNATIONAL_REDUCED = $international_line_details * $internationalf / 100;
$OTHER_REDUCED = $other_line_details * $other_mobilef / 100;

$TOTAL_REDUCED_6 = $OTHER_REDUCED + $INTERNATIONAL_REDUCED + $VODAFONE_REDUCED + $ORANGE_REDUCED + $TMOBILE_REDUCED + $O2_REDUCED + $NATIONAL_REDUCED + $LOCAL_REDUCED + $ANALOGUE_LINES_REDUCED + $ISDN_THIRTY_REDUCED + $ISDN2_REDUCED;
$TOTAL_REDUCED_6 = number_format($TOTAL_REDUCED_6);
}

$TOTALS = array($TOTAL_REDUCED_1, $TOTAL_REDUCED_2, $TOTAL_REDUCED_3, $TOTAL_REDUCED_4, $TOTAL_REDUCED_5, $TOTAL_REDUCED_6);

print_r($TOTALS[0][0]); 
print_r($TOTALS[0][1]); 
print_r($TOTALS[0][2]); 
print_r($TOTALS[0][3]); 
print_r($TOTALS[0][4]); 
print_r($TOTALS[0][5]);

Link to comment
https://forums.phpfreaks.com/topic/68998-arrays-grrrr/#findComment-346922
Share on other sites

Over 1000 lines? This is currently about 1,000 in total because it works in steps. This problem is with Step One so God help me with the rest!

 

1) supplier name is the name of the telecoms supplier that is offering the figures that we're putting in numerical order.

 

2) that code actually doesn't display anything at all for some strange reason!

Link to comment
https://forums.phpfreaks.com/topic/68998-arrays-grrrr/#findComment-346929
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.