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();
?>
This entry was posted in Basic PHP and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

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