A place to relax and discuss.
HomePortalFAQSearchRegisterMemberlistUsergroupsLog in

Share | 

 PHP: Functions

Go down 
New Otaku
New Otaku

Number of posts : 85
Registration date : 2007-04-21

PostSubject: PHP: Functions   Sat May 05, 2007 6:12 pm

Okay, so you have a bunch of php code that does the SAME THING, and you dont want to keep copying and pasteing it.. So.. you make a function ;D

Heres an example redirect function..

function redirect ($url) {
header("Location: " . $url);

redirect is the function name, and ($url) is where you set the vars that are passed to it..

So.. you have this function.. but how do you call it? Easy!


Alright so lets say you want a function to call someone something... it would go like this..

function callname ($who,$what) {
echo $who . " is a " . $what;

So now you would call it like this..

callname("Blueangel","hawt chick.");

And you would get..

Blueangel is a hawt chick.
Back to top Go down
View user profile
PHP: Functions
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Tong-Pak-Fu :: Graphics And Web Discussion :: Photoshop/Webdesign :: Tutorial :: Web Design Tutorials-
Jump to: