how to separate the individual value from userinfo object in concrete5 userinfo mode

StackOverflow https://stackoverflow.com/questions/20094839

  •  03-08-2022
  •  | 
  •  

Question

what i am trying is, to separate the particular value in the record set object, my sample code,

$oUser = UserInfo::getByEmail($em);
            echo "<pre>";
            print_r($oUser);
            foreach($oUser as $key=>$value){
               echo $value['uNumLogin'];
            }

the output of print_r is

UserInfo Object
(
    [error] => 
    [uID] => 16
    [uLastLogin] => 1384932506
    [uLastIP] => 0
    [uIsValidated] => -1
    [uPreviousLogin] => 1384932463
    [uIsFullRecord] => 1
    [uNumLogins] => 0
    [uDateAdded] => 0000-00-00 00:00:00
    [uIsActive] => 1
    [uLastOnline] => 1384932508
    [uHasAvatar] => 0
    [uName] => empdhivya
    [uEmail] => shankumars@gmail.com
    [uPassword] => 3917b4028f23f1d33fea9af856f0bd8b
    [uTimezone] => 
)

but i try this code

foreach($oUser as $key=>$value){
                   echo $value['uNumLogin'];
                }

it shows the output

110-1100110es3

please anybody help me how to solve this?

Was it helpful?

Solution

this will work perfectly for separate value from record set object

foreach($oUser as $key=>$value){
   if($key=='uNumLogins')
    $val = $value;
}

this answer workout myself for my requirement if any mistake in this please correct my mistake.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top