Malhar Lathkar has Published 189 Articles

PHP Error Control Operator

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 13:42:18

1K+ Views

IntroductionIn PHP @ symbol is defined as Error Control Operator. When it is prefixed to any expression, any error encountered by PHP parser while executing it will be suppressed and the expression will be ignored.Following code tries to open a non-existing file for read operation, but PHP parser reports warningExample Live ... Read More

PHP Array Operators

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 13:38:01

2K+ Views

IntroductionPHP defines following set of symbols to be used as operators on array data typesSymbolExampleNameResult+$a + $bUnionUnion of $a and $b.==$a == $bEqualityTRUE if $a and $b have the same key/value pairs.===$a === $bIdentityTRUE if $a and $b have the same key/value pairs in the same order and of the ... Read More

PHP Expressions

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 13:18:02

6K+ Views

IntroductionAlmost everything in a PHP script is an expression. Anything that has a value is an expression. In a typical assignment statement ($x=100), a literal value, a function or operands processed by operators is an expression, anything that appears to the right of assignment operator (=)Syntax$x=100; //100 is an expression ... Read More

PHP switch Statement

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 13:16:23

2K+ Views

IntroductionIf a program needs a series of if statements that perform different process for vaarying value of an expression, it may get very clumsy with each if statement having its own set of curly brackets. This is where using swtich-case construct can make the program compact and readable. With switch ... Read More

PHP goto Statement

Malhar Lathkar

Malhar Lathkar

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

4K+ Views

IntroductionThe goto statement is used to send flow of the program to a certain location in the code. The location is specified by a user defined label. Generally, goto statement comes in the script as a part of conditional expression such as if, else or case (in switch construct)Syntaxstatement1; statement2; ... Read More

PHP foreach Loop.

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 13:11:49

1K+ Views

IntroductionThe foreach statement is one of the looping constructs offered by PHP. Other looping statements − while, do while and for − are used to form a conditional or counted loop. On the other hand, foreach loop is very convenient for iterating over an array structure. Usage of foreach statement ... Read More

PHP if else elseif

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 13:07:18

2K+ Views

IntroductionConditional execution of one or more statements is a most important feature of any programming language. PHP provides this ability with its if, else and elseif statements. Primary usage of if statement is as follows −Syntaxif (expression)    statement;The expression in front of if keyword is a logical expression, evaluated ... Read More

PHP continue Statement

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 12:44:58

2K+ Views

IntroductionThe continue statement is one of the looping control keywords in PHP. When program flow comes across continue inside a loop, rest of the statements in current iteration of loop are skipped and next iteration of loop starts. It can appear inside while, do while, for as well as foreach ... Read More

PHP break Statement

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 12:42:39

1K+ Views

IntroductionThe break statement is one of the looping control keywords in PHP. When program flow comes across break inside while, do while, for as well as foreach loop or a switch construct, remaining statements in the loop/swtich is abandoned and statements after the same will be executed.Syntaxwhile (expr) {   ... Read More

PHP Variable functions

Malhar Lathkar

Malhar Lathkar

Updated on 18-Sep-2020 14:00:58

8K+ Views

IntroductionIf name of a variable has parentheses (with or without parameters in it) in front of it, PHP parser tries to find a function whose name corresponds to value of the variable and executes it. Such a function is called variable function. This feature is useful in implementing callbacks, function ... Read More

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