Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8532553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:44:30+00:00 2026-06-11T09:44:30+00:00

public function GetOpsPremiums() { // Get the Cost Multiplier $costMulti = $this->GetCostMultiplier(); // Get

  • 0
   public function GetOpsPremiums()
    {
        // Get the Cost Multiplier
        $costMulti  = $this->GetCostMultiplier();
        // Get the Prem Ops
        $premOps    = $this->GetPremOpsEL();
        // Get the Factors
        $factors    = $this->GetFactors();

        // Get the full class array
        $classArray = $this->GetClassArray();

        foreach ($classArray as $key => $values) {
            $classTotalHalved = $values / 1000;
            $mainMultiplier = $costMulti * $premOps[$key] * $factors[$key]['premops'];
            $premium = $classTotalHalved * $mainMultiplier;
            $opsPremiums = array(
                            $key => round($premium)
                        );
        }
        return $opsPremiums;
    }

I want $opsPremiums to not just iterate 1 at a time. I need it to iterate and add itself to itself.

I tried

foreach ($opsPremiums as $key2 => $values2) {
     $opsPremiums = array(
                         $key => round($premium)
                    );
}

Can someone explain to me what I need to do in order to get the $opsPremium to stack itself neatly into a single array?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:44:31+00:00Added an answer on June 11, 2026 at 9:44 am

    should be so

    foreach ($opsPremiums as $key2 => $values2) {
    
     $opsPremiums[] = array(
                         $key => round($premium)
                    );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My action: public function executeEdit(sfWebRequest $request) { // Get the object $article = $this->getRoute()->getObject();
public function executeShow(sfWebRequest $request) { $this->category = $this->getRoute()->getObject(); $this->pager = new sfDoctrinePager( 'JobeetJob', sfConfig::get('app_max_jobs_on_category')
public function init(){ $this->view->user = Zend_Auth::getInstance()->getIdentity(); $this->view->siteName = Zend_Registry::get('config')->site->name; $this->view->menu = $this->_helper->generateMenu(Zend_Auth::getInstance()->getIdentity()); $this->view->slogan =
public function create($tableName, $userInput) { $this->db->insert($tableName, $userInput); return $this->db->affected_rows(); } As you see, $this->db->affected_rows();
public function action_adicionar_item() { $lista_item_pedido = array(); $x = 0; if(Session::has('lista_item_pedido')) { foreach(Session::get('lista_item_pedido') as
public function getItemsCollection($useCache = true) { if (is_null($this->_items)) { $this->_items = Mage::getModel('sales/quote_item')->getCollection(); $this->_items->setQuote($this); }
public function configure() { $this->widgetSchema['start_date'] = new sfWidgetFormInput(); $this->widgetSchema['end_date'] = new sfWidgetFormInput(); $this->validatorSchema->setPostValidator( new
public function index() { $this->redirect('/'); } I will just go insane soon... How can
public function admin_view($user_id = NULL) { debug($this->User); exit; } public function view($user_id = null)
public function create() { echo $this->equipment->getCatId() . <br/>; echo $this->equipment->getName() . <br/>; echo $this->equipment->getYear()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.