Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use built-in functions and user-defined functions in PHP

Shulou Source: shulou.com Published: 2022-06-01 13:13:30 10月07日 Update

This article mainly shows you the "built-in functions and user-defined functions in PHP how to use", the content is easy to understand, clear, hope to help you solve your doubts, the following let Xiaobian lead you to study and learn "PHP built-in functions and user-defined functions how to use" this article.

PHP syntax

The PHP script is executed on the server and then sends back pure HTML results to the browser.

PHP scripts can be placed anywhere in the document. The PHP script ends with "":

The default file extension for PHP files is ".php". The file usually contains the HTML tag and some PHP script code:

My first PHP page

Note: use the built-in PHP function "echo" to output the text "Hello World!" on the web page. A PHP script of.

Tip: the PHP statement ends with a semicolon (the last line can be omitted), and the closing label of the PHP code block automatically indicates the semicolon.

PHP comment

Comments in PHP code are not read and executed as programs. Its only function is for code editors to read.

1. Make others understand what you are doing-comments let other programmers know what you are doing at each step.

2. Remind yourself of what you've done-comments can record your thoughts as you write code. PHP supports three types of annotations:

PHP is case sensitive

In PHP, all user-defined functions, classes, and keywords (such as if, else, echo, and so on) are case-insensitive.

Note: in PHP, all variables are case-sensitive.

Tip: in this example, $color, $COLOR, and $coLOR are treated as three different variables.

These are all the contents of the article "how to use built-in functions and user-defined functions in PHP". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Functions comments code scripts users content variables files articles statements semicolons uppercase lowercase tags programs study work help tips different Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology NVidia Docker Microsoft Linux