This page will show two examples of functions. One wil be a built-in function, and one will be a user-defined function.

Below is my example of a built-in function in PHP
The simlish phrase SulSul and DagDag contains 18 characters including spaces and the exclamation point.

Below this is a user-defined function

SulSul, Emily
SulSul, Cameron
SulSul, John

Built-in Function Explanation

For the built-in function, I used the strlen() function. This function counts the amount of characters that are in a string including spaces, punctuation, etc. Then, when the function is called again, it displays how many characters are in that string. Since the phrase I chose to count the string length of had 18 characters, the function stated that the phrase had 18 characters when it was called.

User-defined Function Explanation

For the user-defined function, I chose to do a simple function that would greet people by their first name with the simlish greeting SulSul, which means hello. How this function works is that I had my function take the argument of $fname, and then inside the function I concatenated the greeting with the function argument in the echo statement in the function. Then, When the function is called, I put actual first names instead of $fname so the function was greeting real people. I called this function multiple times to get the result shown above these explanations.