Malhar Lathkar has Published 189 Articles

PHP Callbacks/Callables

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:26:10

590 Views

Definition and UsageCallback is a pseudo-type in PHP. With PHP 5.4, Callable type hint has been introduced, which is similar to Callback. When some object is identified as callable, it means that it can be used as a function that can be called. A callable can be a built-in or ... Read More

PHP Boolean Data Type

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:23:53

7K+ Views

Definition and UsageThis is one of the scalar data types in PHP. A boolean data can be either TRUE or FALSE. These are predefined constants in PHP. The variable becomes a boolean variable when either TRUE or FALSE is assigned.SyntaxResult of echoing TRUE value displays 1 while for FALSE it ... Read More

PHP Associative Array

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:22:11

2K+ Views

Definition and UsageIn PHP, an array is a comma separated collection of key => value pairs. Such an array is called Associative Array where value is associated to a unique key. The key part has to ba a string or integer, whereas value can be of any type, even another ... Read More

PHP Tags

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:19:48

7K+ Views

Definition and UsageA PHP code script is a text file having .php extension and is stored on web server. The PHP parser on server looks for special sequence of characters . These are called PHP's opening and closing tags. Statements witihn these two are interpreted by the parser. PHP script ... Read More

PHP Escaping From HTML

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:16:46

1K+ Views

Definition and UsagePHP file can have mixed content with code within tags embedded in a HTML document. Code outside tags is ignored by the parser, leaving it to be interpreted by client browser. A HTML document can have multiple blocks of PHP, each inside tags.Syntax HTML block ... Read More

PHP Type Operators

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:14:00

306 Views

IntroductionIn PHP, it is possible to ascertain whether a given variable is an object of a certain class or not. For this purpose PHP has instanceof operator.Syntax$var instanceof classThis operator returns a boolean value TRUE of $var is an object of class, otherwise it returns FALSEExampleIn following example, instanceof operator ... Read More

PHP String Operators

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 13:55:43

3K+ Views

IntroductionThere are two operators for working with string data types. The '.' (dot) operator is PHP's concatenation operator. Two string operands are joined together (characters of right hand string appended to left hand string) and returns a new string. PHP also has .= operator which can be termed as concatenation assignment operator string on ... Read More

PHP Operator Precedence

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 13:53:05

5K+ Views

IntroductionPrecedence of operators decides the order of execution of operators in an expression. For example in 2+6/3, division of 6/3 is done first and then addition of 2+2 takesplace because division operator / has higher precedence over addition operator +. To force a certain operator to be called before other, ... Read More

PHP Increment/Decrement Operators

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 13:50:56

9K+ Views

IntroductionC style increment and decrement operators represented by ++ and -- respectively are defined in PHP also. As the name suggests, ++ the increment operator increments value of operand variable by 1. The Decrement operator -- decrements the value by 1. Both are unary operators as they need only one ... Read More

PHP Execution Operator

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 13:47:10

968 Views

IntroductionThere is one Execution operator defined in PHP. A string inside back-ticks (``) is treated as a DOS command (a shell command in UNIX/Linux) and its output is returned. This operator is similar in operation to shell_exec() function in PHP.Following code executes DIR command and returns result as string.ExampleOutputFollowing result ... Read More

Previous 1 ... 5 6 7 8 9 ... 19 Next
Advertisements