Jump to content

If statement


Recommended Posts

what are you having trouble with? Are you familiar with conditional statements/logic?http://www.w3schools.com/php/php_if_else.asp

Link to post
Share on other sites

That's the thing. I don't know what code you're using to "show" the dates, so I have no idea what to tell you. As a rule, people get better results here if they post the relevant code they are confused about. We probably don't need to see your whole script, just the part with the problem you need to solve.

Link to post
Share on other sites

You could invert the conditon - always display the start date, and if the dates are NOT the same, display the end date as well, e.g.

//Do whatever you do to "show" the date e.g. "echo $event->StartDate;"if ($event->StartDate !== $event->EndDate) {//Do whatever you need to do to also "show" the end date, including outputting a separator, e.g. "echo '-', $event->EndDate;"}

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...