PHP error. Why is “variable undefined” inside array_map?

前端 未结 1 1494
自闭症患者
自闭症患者 2021-02-01 13:29

I am using array_map function in my php application. I defined the array_map function like this.

$ratingID =  $this->db->insert_id();

    $r         


        
相关标签:
1条回答
  • 2021-02-01 13:46
    $rated_item_array = array_map(
      function ($a) use ($ratingID){ 
        return $a + array('RatingID' => $ratingID ); 
      }, 
      $rated_item_array
    );
    
    0 讨论(0)
提交回复
热议问题