You should always read the official documentation.
Here is the page for user-defined functions: https://www.php.net/manual/en/functions.user-defined.php
You can also use offline documentation program for software developers: Zeal. I use it a lot!
Here is the code to sum up 3 numbers - it is a nice and easy example of creating own functions:
<?php
function sum( $a, $b, $c ) {
echo $a + $b + $c;
echo '<br>';
}
$x = 100;
$y = 10;
$c = 1000;
sum( $x, $y, $c );
sum( 3, 9, 90 );
?>
and the results:

On liine #3 where the function is declared in the brackets of sum() - you should I add your own parameters - and then you can use variables or your defined numbers/string, etc.