Originally Posted by melbin http://php.flashwebhost.com/melbin/days.php PHP Code: <?php$day='Sunday';if ($day="Sunday") { echo 'Have a nice Sunday';}else { echo 'Have a nice day';} In this code when i use == on line no:3 i am getting the result as FALSE. Why ? = is assignment operator, that means you are just assigning a value to variable $day. Use == operator to check if value is same or not. Originally Posted by melbin Doubt 2 Is it possible to get the day by using PHP date and time function ? It is possible using date() function.
<?php$day='Sunday';if ($day="Sunday") { echo 'Have a nice Sunday';}else { echo 'Have a nice day';}
Become PHP Expert in 30 days FreeMarriage.com - Free Online Matrimonial FlashWebHost.com - Professional Web Hosting, Designing.
View Tag Cloud
Forum Rules
Bookmarks