create function with if php code example Example: function php function functionName() { //code to be executed; }