|
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-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Mar 22 22:00:01 2026 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