GetDotted Domains

Viewing Thread:
"PHP Function"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Thu 07/02/02 at 21:02
Regular
Posts: 787
Hey could anyone give me a small example of creating your own fucntion in PHP i've looked every where but cant find nothing...
Thanks
Fri 08/02/02 at 00:01
Regular
"It goes so quickly"
Posts: 4,083
Couldn't find the site??

Try: http://registration.freeola.net/php/manual.html then, as Freeola have downloaded the PHP Manual, though it's not the clearest way to learn.

I found a book to be better, PHP 4 Teach yourself in 24 Hours was what did it for me :o).
Thu 07/02/02 at 22:35
Posts: 0
perfect thanks alot i checked the php site but couldnt find it thanks again
Thu 07/02/02 at 22:30
Regular
"Eff, you see, kay?"
Posts: 14,156

function HelloWorld() {

echo "Hello world";

}

function coffee($name, $coffee) {
// call like any other program, eg coffee("Bob", "mocha");

echo "$name's favourite coffee is $coffee";

}

function coffee($name="Bob", $coffee="mocha") {
// sets default values, so $name contains "Bob" and $coffee contains
// "mocha", unless you define them otherwise

echo "$name's favourite coffee is $coffee";

}

?>

Of course, there's always someone who explains it better. In this case, it's the guy that wrote the manual:

http://www.php.net/manual/en/functions.php#functions.user-defined

;)
Thu 07/02/02 at 22:00
Regular
"It goes so quickly"
Posts: 4,083

function MyFirstFunction() {
print "Hello Wolrd\n";
}

MyFirstFunction();

?>

===========================================

Thats how a function would look, although you would usually have more code within it to execute.

Is this the kind of example you were after??? If not, sorry, but come back and I'll try again :o).
Thu 07/02/02 at 21:02
Posts: 0
Hey could anyone give me a small example of creating your own fucntion in PHP i've looked every where but cant find nothing...
Thanks

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Continue this excellent work...
Brilliant! As usual the careful and intuitive production that Freeola puts into everything it sets out to do, I am delighted.
Wonderful...
... and so easy-to-use even for a technophobe like me. I had my website up in a couple of hours. Thank you.
Vivien

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.