HexCon is coming to NYC. Catch the early-bird price before the time's up! REGISTER NOW

Copy code testingSolved

Hexnode Expert
Discussion
8 months ago

Creating (Declaring) PHP Variables

In PHP, a variable starts with the $ sign, followed by the name of the variable:

In the example above, the variable $x will hold the value 5, and the variable $y will hold the value “John”.

Note: When you assign a text value to a variable, put quotes around the value.

Note: Unlike other programming languages, PHP has no command for declaring a variable. It is created the moment you first assign a value to it.

PHP – Using Iterables

The iterable keyword can be used as a data type of a function argument or as the return type of a function:

Replies (0)

Be the first to reply!
Save