0 Kommentare
0 Anteile
7KB Ansichten
0 Vorschau
Verzeichnis
Entdecken Sie neue Leute, neue Verbindungen zu schaffen und neue Freundschaften
-
Please log in to like, share and comment!
-
PHP NumbersIn this chapter we will look in depth into Integers, Floats, and Number Strings. PHP Numbers There are three main numeric types in PHP: Integer Float Number Strings In addition, PHP has two more data types used for numbers: Infinity NaN Variables of numeric types are created when you assign a value to them: ExampleGet your own PHP Server $a = 5; $b = 5.34; $c = "25";...0 Kommentare 0 Anteile 4KB Ansichten 0 Vorschau
-
PHP CastingSometimes you need to change a variable from one data type into another, and sometimes you want a variable to have a specific data type. This can be done with casting. Change Data Type Casting in PHP is done with these statements: (string) - Converts to data type String (int) - Converts to data type Integer (float) - Converts to data type Float (bool) - Converts to...0 Kommentare 0 Anteile 3KB Ansichten 0 Vorschau
-
PHP MathPHP has a set of math functions that allows you to perform mathematical tasks on numbers. PHP pi() Function The pi() function returns the value of PI: ExampleGet your own PHP Server echo(pi()); Try it Yourself » PHP min() and max() Functions The min() and max() functions can be used to find the lowest or highest value in a list of arguments:...0 Kommentare 0 Anteile 4KB Ansichten 0 Vorschau
-
PHP ConstantsConstants are like variables, except that once they are defined they cannot be changed or undefined. PHP Constants A constant is an identifier (name) for a simple value. The value cannot be changed during the script. A valid constant name starts with a letter or underscore (no $ sign before the constant name). Note: Unlike variables, constants are automatically global across the...0 Kommentare 0 Anteile 5KB Ansichten 0 Vorschau
-
PHP Magic ConstantsPHP Predefined Constants PHP has nine predefined constants that change value depending on where they are used, and therefor they are called "magic constants". These magic constants are written with a double underscore at the start and the end, except for the ClassName::class constant. Magic Constants Here are the magic constants, with descriptions and examples: Constant...0 Kommentare 0 Anteile 3KB Ansichten 0 Vorschau
-
PHP OperatorsPHP Operators Operators are used to perform operations on variables and values. PHP divides the operators in the following groups: Arithmetic operators Assignment operators Comparison operators Increment/Decrement operators Logical operators String operators Array operators Conditional assignment operators PHP Arithmetic Operators The PHP arithmetic operators are used with...0 Kommentare 0 Anteile 6KB Ansichten 0 Vorschau
-
PHP if StatementsConditional statements are used to perform different actions based on different conditions. PHP Conditional Statements Very often when you write code, you want to perform different actions for different conditions. You can use conditional statements in your code to do this. In PHP we have the following conditional statements: if statement - executes some code if one condition is...0 Kommentare 0 Anteile 3KB Ansichten 0 Vorschau
-
PHP if OperatorsComparison Operators If statements usually contain conditions that compare two values. ExampleGet your own PHP Server Check if $t is equal to 14: $t = 14; if ($t == 14) { echo "Have a good day!"; } Try it Yourself » To compare two values, we need to use a comparison operator. Here are the PHP comparison operators to use in if statements:...0 Kommentare 0 Anteile 3KB Ansichten 0 Vorschau
-
PHP if...else StatementsPHP - The if...else Statement The if...else statement executes some code if a condition is true and another code if that condition is false. Syntax if (condition) { // code to be executed if condition is true; } else { // code to be executed if condition is false; } ExampleGet your own PHP Server Output "Have a good day!" if the current time is less than 20, and "Have...0 Kommentare 0 Anteile 3KB Ansichten 0 Vorschau