Sorry for late reply. My laptop got defect, and I couldnt do further
on that work. Now borrowed my friends and continuing on my work.
Thanks for the help. But I tried empty($duration) but still no change.
Then I don't understand why it works with other trim() statements and
this one not. Are you sure the if-else statement is written correctly?