PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, February 15, 2022

[FIXED] How to push these variable into an array and return their whole result as a single array

 February 15, 2022     php, yii, yii2, yii2-advanced-app     No comments   

Issue

I want execute three queries independently to get three different rows from the database and want return their result as a single array. I am doing this as in image but its not working:

I also try to use push method as you can see in the comments and that one also disappoint me. Need your kind help please.


Solution

Have you tried php method array_merge() ?

$array1 = array("color" => "red", 2, 4);
$array2 = array("a", "b", "color" => "green", "shape" => "trapezoid", 4);
$result = array_merge($array1, $array2);


Answered By - darjus
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing