Jump to content

Turn this code into a function?


Mr Chris

Recommended Posts

Hello All,

 

I'm trying to put a lot of what I do into function calls now to make my code a bit tidier and consise.  Take this simple if statement:

 

if ($_GET['thedate'] =='') {
$var = date('l, jS F, Y',time());
} else {
$var = date('l, jS F, Y', strtotime($_GET['thedate']));
}

 

How could I put this into a function and in some kind of switch statement?

 

Thanks

Link to comment
Share on other sites

@Pikachu2K, You made me laugh

@ignace, yes I thought English was your native language, but now in my mind when I read your posts, your voice sounds like Stevie Hawkins

 

@Mr Chris, Did you even try to use a switch statement in a function before posting?

Of course you can use switch in a function.

 

Q. Are you the same Mr Chris from sheffieldforum.co.uk?

Link to comment
Share on other sites

Thing is I hear Dutch a lot of the time because i'm a keen Blender user and the majority of tutorials are by Dutch peeps (since it's primary developer base and institute is there).

 

I always imagine / copy voices of people, it the animator in me.

 

... On another note, Steven Hawkings voice could be updated to be a lot more natural, but he prefers it because it is now a part of him...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.