Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

create function php

<?php
  #Syntax:
  function functionName() {
    code to be executed;
  }

  function Greetings() {
    echo "Hello, welcome!";
  }
  
  Greetings(); #Execute function 

  #Function arguements

  #Function arguements are just like prefixes/suffixes and can have multiple arguements

  function Polygon(str $prefix = penta, str $suffix = gon) {
    echo "$prefix$suffix"
  }

  Polygon("tetra", "gon");
  Polygon(); #Here, we use default value
  Polygon("hexa", "gon");
  Polygon("septa", "gon");
?>
 
PREVIOUS NEXT
Tagged: #create #function #php
ADD COMMENT
Topic
Name
8+8 =