Sum动态数组同名php

时间:2017-12-08 09:03:51

标签: php sql arrays dynamic sum

C:\wamp64\www\uthayan\application\views\content\circulation\reports\supinv.php:273:
array (size=2)

0 => 
    object(stdClass)[411]

      public 'arid' => string '4815' (length=4)
      public 'agid' => string '199' (length=3)
      public 'ptype' => string '1' (length=1)
      public 'number' => string '32' (length=2)
      public 'date' => string '2017-11-14' (length=10)
      public 'user' => string '21' (length=2)
      public 'arstatus' => string '2' (length=1)
      public 'invID' => string 'CIR/IN/2017/004550' (length=18)
      public 'price' => string '20' (length=2)
      public 'mid' => string '2531' (length=4)
      public 'pid' => string '1' (length=1)
      public 'pname' => string 'Daily Paper' (length=11)
      public 'pamount' => string '20' (length=2)
      public 'pstatus' => string '1' (length=1)

  1 => 
    object(stdClass)[412]

      public 'arid' => string '4816' (length=4)
      public 'agid' => string '199' (length=3)
      public 'ptype' => string '2' (length=1)
      public 'number' => string '1' (length=1)
      public 'date' => string '2017-11-14' (length=10)
      public 'user' => string '21' (length=2)
      public 'arstatus' => string '2' (length=1)
      public 'invID' => string 'CIR/IN/2017/004550' (length=18)
      public 'price' => string '30' (length=2)
      public 'mid' => string '2531' (length=4)
      public 'pid' => string '2' (length=1)
      public 'pname' => string 'Weekly Paper' (length=12)
      public 'pamount' => string '30' (length=2)
      public 'pstatus' => string '1' (length=1)
C:\wamp64\www\uthayan\application\views\content\circulation\reports\supinv.php:273:
array (size=2)

 0 => 
    object(stdClass)[413]

      public 'arid' => string '4817' (length=4)
      public 'agid' => string '200' (length=3)
      public 'ptype' => string '1' (length=1)
      public 'number' => string '51' (length=2)
      public 'date' => string '2017-11-14' (length=10)
      public 'user' => string '21' (length=2)
      public 'arstatus' => string '2' (length=1)
      public 'invID' => string 'CIR/IN/2017/004551' (length=18)
      public 'price' => string '20' (length=2)
      public 'mid' => string '2532' (length=4)
      public 'pid' => string '1' (length=1)
      public 'pname' => string 'Daily Paper' (length=11)
      public 'pamount' => string '20' (length=2)
      public 'pstatus' => string '1' (length=1)
  1 => 
    object(stdClass)[414]

      public 'arid' => string '4818' (length=4)
      public 'agid' => string '200' (length=3)
      public 'ptype' => string '2' (length=1)
      public 'number' => string '8' (length=1)
      public 'date' => string '2017-11-14' (length=10)
      public 'user' => string '21' (length=2)
      public 'arstatus' => string '2' (length=1)
      public 'invID' => string 'CIR/IN/2017/004551' (length=18)
      public 'price' => string '30' (length=2)
      public 'mid' => string '2532' (length=4)
      public 'pid' => string '2' (length=1)
      public 'pname' => string 'Weekly Paper' (length=12)
      public 'pamount' => string '30' (length=2)
      public 'pstatus' => string '1' (length=1)

上面的数组我有动态我需要将pname和amount作为一个数组求和,请给我任何想法?

0 个答案:

没有答案