Getting started with function – Installation or Setup

A function is a block of organised, reusable code that is used to perform a single, related action. Functions usually "take in" data, process it, and "return" a result.

User defined function

A function defined by user.

Example in PHP

   //Function definition

    function add ($a, $b)
    {
        $sum = $a + $b;
        return $sum;
    }
    
    //Function invokation
    
    $sum = add(1,2);

if you want to reproduce, please indicate the source:
Getting started with function – Installation or Setup - CodeDay