alexjewell
08-26-2006, 09:21 PM
I'm using functions on a website I'm creating.
I'm curious if we can use if statements, etc in a function?
For example:
function my_function($yeah) {
if (...) {....}
elseif (...) {....}
else {....}
}
the periods obviously represent the content...
at any rate, is such a thing possible?
I have statements that repeat themselves, with just one part changing. so I figured if I could just call a function for it, I wouldn't have to keep rewriting the statements?
Thanks
I'm curious if we can use if statements, etc in a function?
For example:
function my_function($yeah) {
if (...) {....}
elseif (...) {....}
else {....}
}
the periods obviously represent the content...
at any rate, is such a thing possible?
I have statements that repeat themselves, with just one part changing. so I figured if I could just call a function for it, I wouldn't have to keep rewriting the statements?
Thanks