Hi all
Yep, I'm a noob so go lightly please ;D
Can someone please assist me with finding the conditional problem here. Its part functioning ??? I.O.W. - I'm not sure where the conditional problem lies. It executes the first part of the code. That is, it does assign values to $year, $month and $day but the condition is wrong - it executes whether the string length is 6 or 5 characters :'(
ANY help is appreciated
if (trim(strlen($user['user_birthday'])) != 6 )
{
$year = substr($user['user_birthday'], 4, 4);
$month = substr($user['user_birthday'], 0, 2);
$day = substr($user['user_birthday'], 2, 2);
}
else if (trim(strlen($user['user_birthday'])) != 5 )
{
if ($user['user_birthday'] AND $user['user_birthday'] != 999999)
{
if (trim(strlen($user['user_birthday'])) != 6 )
{
$year = substr($user['user_birthday'], 4, 4);
$month = substr($user['user_birthday'], 0, 2);
$day = substr($user['user_birthday'], 2, 2);
}
else if (trim(strlen($user['user_birthday'])) != 5 )
{
$year = substr($user['user_birthday'], 3, 4);
$month = substr($user['user_birthday'], 0, 1);
$day = substr($user['user_birthday'], 1, 2);
}
$try->set_value('nonmandatory', 'birthday', "{$month}-{$day}-{$year}");
$try->set_value('nonmandatory', 'birthday_search', "{$year}-{$month}-{$day}");
}