# Simple array order problem , need help

**URL:** <https://forum.kirupa.com/t/simple-array-order-problem-need-help/291675>\
**Category:** Uncategorized\
**Created:** [July 2, 2009, 11:00pm UTC](https://forum.kirupa.com/t/simple-array-order-problem-need-help/291675 "2009-07-02T23:00:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddenim](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@ddenim](https://forum.kirupa.com/u/ddenim)\
**Post date:** [July 2, 2009, 11:00pm UTC](https://forum.kirupa.com/t/simple-array-order-problem-need-help/291675/1 "2009-07-02T23:00:59Z")

</div>

php simple array ordering problem 🙂

hi all, who can help me with that : i need to order the values of the array after adding taxes (tva mean VAT), how to order the array before and after vat addition ?  
can u give 2 axamples ?

thank u.

\<?php

$s=0;  
$salariers=array(‘a’=\>25000,‘b’=\>30000,‘c’=\>40000,‘d’=\>20000);  
print\_r ($salariers);

echo “\<br\>”;

foreach ($salariers as $a =\> $value) {

```
 for ($i=0;$i&lt; 4; $i++){

  $s=$s[$i]+$value;
  
  }

```

$calculatemax = array($i);  
$i=$i+1;  
$vat = (($value)\*(.17));  
$total = ($s+$vat);  
echo ($a.$s.’&nbsp;‘.$vat.’&nbsp;'.$total);  
echo “\<br\>”;

}

?\>  
\</body\>  
\</html\>
