|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-27 13:02 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 00:00:01 2025 UTC |
Description: ------------ running the code below will ouput the weekday value and the Unix datecode! - obviously I have shortened my code so this is non relevant as there is another way but I'm not sure this should happen (it would be interesting to know why?) this can be resolved by changing if ($element[key] == "weekday" ) to if ($element[key] == "weekday" && $element[key] != "0") Reproduce code: --------------- <html> <body> <? $timestamp = date ("U"); $day1a = getdate ($timestamp); while ( $element = each ($day1a)) { if ($element[key] == "weekday" ) { $day = $element[value]; echo " Day "; echo $day; echo "<br><br>"; } } ?> </body> </html> Expected result: ---------------- Day Tuesday Actual result: -------------- Day Tuesday Day 1075224592