5
Maybe you should study the syntax first.
for($i = 0; $i <= $grupos.length + 1; $i++){
1. Your variable $grupos is different from $group
2. There are no methods on non-objects (a string or an array is not an object in PHP)
3. Even if it was an object, methods are called with -> not . (a dot)
so this should work:
$groups = $xoopsUser->getGroups();
for($i = 0; $i < count($groups); $i++){
if($grupos[$i] == 4){
$ifCliente = 1;
}else{
$ifCliente = 0;
}
}
should work - or even better:
$groups = $xoopsUser->getGroups();
$ifCliente = in_array(4, $groups) ? 1 : 0;