PHP Tutorial : Writing your own custom functions

Errrr,

I dont know which hello word to say for this post to keep the “unique” style so will start explaining how you can do it. Firstly, you have red about a lot of “ready made” php functions which comes with the language. Now it’s time to create your own functions with your own name (must be different than existent funtions, start with a char not a number, etc etc). How you do it? Simple, by declaring its name, Look:

<?php
function myFirstOne() {

print "what to do?";
}
//and appeal it - will show the message


myFirstOne();
?>

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>