try this,
get role value outside array
$role = "";
$option = $_GET['I-would-like'];
$option = trim($option);
if ($option == 'A quotation' || $option == 'Information')
{
$role="customer";
} else if($option == 'To become a Partner')
{
$role="partners";
} else if ($option == 'Training / Coaching')
{
$role="students";
}
$userdata = array(
'user_login' => $username,
'user_pass' => $password,
'user_email' => $email,
'nickname' => reset($name_parts),
'display_name' => $name,
'first_name' => reset($name_parts),
'last_name' => end($name_parts),
'role' => $role
);
5
solved Parse error: syntax error, unexpected T_IF, expecting ‘)’ What should I do? [duplicate]