Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sub routines? 1

Status
Not open for further replies.

PhoenixDown

Programmer
Jul 2, 2001
279
CA
How do I make a sub in PHP like perl? (sub name {) AIM: XCalvin1984
Email: calvin@puremadnezz.com
MSN: xcloud2000x@hotmail.com
Web Site: Yahoo Messenger: xcloud2000x

Contact me for any programming help and whatnot. I'll try my best to help! :)
 
Hi Calvin0,

PHP doesn't have a
Code:
sub
statement. The way to do it is just to use a
Code:
function() {
block and don't bother with a return value (or set it to
Code:
true
), ie
Code:
function mysub($arg1) {
  // Code of your sub in here
  return true;
}
You can call this with
Code:
mysub("somevalue");

-Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top