Sunday 15 May 2011

php - Problems using in_array and date in if/else -


I am using PHP functions and experiments.

I personally do not understand that my code is refunding the second part of the statement. If is returning the date ('D') Tue , why does not he run that part?

  & lt; Php date_default_timezone_set ('UTC'); $ Weekdays = array ("Mon", "Mars", "Mercury", "Thunder", "Venus", "Saturn", "Sun"); $ Today = Date ('D'); If (in_array ("Mon", "Mars", "Mercury", "Thunder", "Venus", $ Weekdays) == $ Today) {Echo "This is" ""; Echo today $; Echo "" "Get out of bed and go to work"; } Else {dungo "do whatever you want"; Echo today $; }; ? & Gt;   

I have tried many things and changed if to it, but there is no benefit.

  if someone can tell me what is wrong with syntax?   

< Div class = "post-text" itemprop = "text">

in_release function.

If you want to know if $ today There is a weekday, you want to do something like this:

  $ weekdays = array ("Mon", "Mars", "Mercury", "Thunder", "Venus"); If (in_array ($ Today, $ Weekdays)) {...}    

No comments:

Post a Comment