SHARE
TWEET

Untitled

a guest Nov 16th, 2019 91 in 2 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $pageAnswers = [
  4.     (object)['attr'=>['id' => 1132 ]],
  5.     (object)['attr'=>['id' => 3453 ]],
  6.     (object)['attr'=>['id' => 8921 ]],
  7. ];
  8.  
  9. $answers = [];
  10. foreach($pageAnswers as $answerDiv){
  11.     #CREATING ANSWER
  12.    $answer = (object)['type' => 'answer'];
  13.     $answer->{'id'}         = $answerDiv->attr['id'];
  14.  
  15.     #appending answer to answers
  16.    $answers[$answer->{'id'}] = &$answer;
  17. }
  18.  
  19. var_dump($answers)
  20. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top