Jump to content

Mulitiple if's in one if statement?


stewart715

Recommended Posts

is it possible to have more than 1 if statement in an if..for example
[code]
<?php
$row=certain number from sql query

if ($row == 2){
return _phptemplate_callback('user_profile', array('user' => $user, 'fields' => $fields));

} else  if ($row == 1){

if (@in_array($user->uid, array_keys(buddylist_get_buddies($account->uid))) && user_access('maintain buddy list')) {
return _phptemplate_callback('user_profile', array('user' => $user, 'fields' => $fields));

}

else if ($account->uid != $user->uid && user_access('maintain buddy list')) {
return _phptemplate_callback('private_profile', array('user' => $user, 'fields' => $fields));

}

} else  if ($row == NULL){
return _phptemplate_callback('private_profile', array('user' => $user, 'fields' => $fields));

} else {
print 'Privacy mode error';
}
  }?>

[/code[[/code]
Link to comment
https://forums.phpfreaks.com/topic/25722-mulitiple-ifs-in-one-if-statement/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.