How To: Create a PHP Function and use it

Publié le: 10 août 2011
sur la chaîne: debuggify
1,640
2

//how to create a function and use it with php

//first declare it.

//begin
function name_of_the_function($entering_variable){

//code
if($entering_variable == 'Something...'){
//entering variable must equal the provided text otherwise the else statment is executed.
$exit_variable = true;
}else{
//this code will execute only if the if statement is false, the variable does not equal the provided string.
$exit_variable = false;
}

//end
return $exit_variable;
}

//to use it:

//call the function
name_of_the_function('Items to pass');

//this will show: nothing.

//call the function
print name_of_the_function('Items to pass');

//this will show: nothing.


if(name_of_the_function('Items to pass')){
//if name_of_the_function('Items to pass') is true than
print 'OK Good! print this! the function returns true.';
}else{
//if name_of_the_function('Items to pass') is false than
print 'seems like the function returned false.';
}


Sur cette page du site, vous pouvez voir la vidéo en ligne How To: Create a PHP Function and use it durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur debuggify 10 août 2011, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,640 fois et il a aimé 2 téléspectateurs. Bon visionnage!