You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- A PHP script starts with `<?php` and ends with `?>`. You can also use the shorthand PHP tags, `<?` and `?>`, as long as they're supported by the server.
7
+
- PHP statements end with semicolons `;`.
8
+
- Comment: single-line `//`, multi-line begins with `/*` and ends with `*/`.
9
+
10
+
## Variable and Constant
11
+
12
+
`$variable_name = value;`
13
+
`echo $variable_name;`
14
+
15
+
- A variable name can only contain alpha-numeric characters and underscores. (`A-z`, `0-9`, and `_`)
16
+
- A variable name must start with a letter or an underscore.
17
+
- Variable names are case-sensitive. (`$name` and `$NAME` would be two different variables)
18
+
19
+
`define(CONSTANT_NAME, value, case-insensitive);`
20
+
`echo CONSTANT_NAME;`
21
+
22
+
- Constants are similar to variables except that they cannot be changed or undefined after they've been defined.
23
+
- name: Specifies the name of the constant.
24
+
- value: Specifies the value of the constant.
25
+
- case-insensitive: Specifies whether the constant name should be case-insensitive. Default is `false`.
0 commit comments