< Language Tutorials

m (somewhat clearer)
Line 1: Line 1:
 
{{stub}}Functions in PHP are like the [[Custom Blocks|custom blocks]] in Scratch.
 
{{stub}}Functions in PHP are like the [[Custom Blocks|custom blocks]] in Scratch.
==Defining a Function==
+
 
 +
== Defining a Function ==
 
This is how a function is defined in PHP:
 
This is how a function is defined in PHP:
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
 
<?php
 
<?php
 
     function functionName(){
 
     function functionName(){
   
+
        // code...
 
     }
 
     }
 
?>
 
?>
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 06:57, 11 November 2018

Document stub.png This article is a stub. It may be incomplete, unfinished, or have missing parts/sections. If the article can be expanded, please do so! There may be suggestions on its talk page. (Date?)
Functions in PHP are like the custom blocks in Scratch.

Defining a Function

This is how a function is defined in PHP:

<?php
    function functionName(){
        // code...
    }
?>