Malhar Lathkar has Published 189 Answers

PHP Callbacks/Callables

Malhar Lathkar
Published on 19-Sep-2020 14:24:43
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
Published on 19-Sep-2020 14:22:48
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.Syntax<?php //Literal assignment of boolean value to variable $var=TRUE; ?>Result of ... Read More

PHP Associative Array

Malhar Lathkar
Published on 19-Sep-2020 14:21:02
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
Published on 19-Sep-2020 14:17:35
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 <?php and ?>. These are called PHP's opening and closing tags. Statements witihn these two are interpreted by the parser. ... Read More

PHP Escaping From HTML

Malhar Lathkar
Published on 19-Sep-2020 14:14:37
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 <?php and ?> tags.Syntax<p> HTML block ... Read More

PHP Type Operators

Malhar Lathkar
Published on 19-Sep-2020 14:12:58
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
Published on 19-Sep-2020 13:53:49
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
Published on 19-Sep-2020 13:52:18
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
Published on 19-Sep-2020 13:49:05
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
Published on 19-Sep-2020 13:43:47
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.Example<?php $list=`dir ... Read More
Previous 1 ... 4 5 6 7 8 9 10 ... 19 Next
Advertisements