Utwórz funkcję 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");
?>
Rick Astley