fork download
  1. <?php
  2. class users{
  3.  
  4. public $name;
  5. public $fam;
  6. public $age;
  7.  
  8. }
  9.  
  10. $name1=array("сергей","Николай","Светлана");
  11. $fam1=array("Светов","Николаев","Сергеева");
  12. $age1=array("22","17","35");
  13.  
  14. for($i=0; $i<count($name1); $i++) {
  15.  
  16. $q[$i]=new users;
  17. $q[$i]->name=$name1[$i];
  18. $q[$i]->fam=$fam1[$i];
  19. $q[$i]->age=$age1[$i];
  20.  
  21. $userz[]=$q[$i];
  22.  
  23. }
  24.  
  25. print_r($userz);
  26. // your code goes here
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Array
(
    [0] => users Object
        (
            [name] => сергей
            [fam] => Светов
            [age] => 22
        )

    [1] => users Object
        (
            [name] => Николай
            [fam] => Николаев
            [age] => 17
        )

    [2] => users Object
        (
            [name] => Светлана
            [fam] => Сергеева
            [age] => 35
        )

)