Saturday, February 26, 2011

Create-new-function-PHP

Assalamu'alaikum and selamat sejahtera

On this post,we will learn the new function.So,to create new function we just type "function" with name that we desire like this :

function name_that_you_desire(){

print "this is my function!";

}

so,take this code or make your own function and put it inside PHP tag:
<?PHP
function name_that_you_desire(){
print "this is my function!";

}
?>

then run it...nothing happen ryte?its just like the other function..that we need to call it.In this case,we call it:

name_that_you_desire();


<?PHP
name_that_you_desire();

function name_that_you_desire(){

print "this is my function!";

}

?>

or


<?PHP
function name_that_you_desire(){
print "this is my function!";

}
name_that_you_desire();

?>

N/NOTE:custom function...

No comments:

Post a Comment