How To Define a User Function


How To Define a User Function? - PHP Script Tips - Creating Your Own Functions



You can define a user function anywhere in a PHP script using the function statement like this: "function name() {...}". Here is a PHP script example on how to define a user function:

function msg() {
  print("Hello world!\n");

This script will print:

Hello world!

2007-04-24, 4782👍, 0💬