Home  >  Article  >  Backend Development  >  How to create a function in php

How to create a function in php

藏色散人
藏色散人Original
2019-11-13 10:41:133360browse

How to create a function in php

How to create a function in php?

Create a php file named function.

How to create a function in php

Add the keyword function to define the function in the file

How to create a function in php

Add a custom function after function Name

How to create a function in php

Add a pair of brackets after the custom function name.

How to create a function in php

Add a pair of curly brackets after the brackets to store a string output by the code block.

How to create a function in php

How to create a function in php

Add a statement that calls the custom function and run the file in the browser.

How to create a function in php

How to create a function in php

Note

Do not add a semicolon after brackets and curly braces

The above is the detailed content of How to create a function in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn