Thread: Functions?
View Single Post
  #2 (permalink)  
Old Feb 3rd, 2008, 15:19
alexgeek's Avatar
alexgeek alexgeek is offline
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,800
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Functions?

This is to declare functions:
PHP: Select all

function say($what) {
echo 
$what;
}
// and call it with
say("Hello");
// you can put anything in a function and set returns
function isTrue($b) {
if(
$b == true) { return true; } else { return false; }
}

//the following will output hi
if(isTrue(1)) { echo 'hi'; } 
Hope that helps a bit.
Reply With Quote