Array In PHP: In Brief

#ARRAY INTRODUCTION #ARRAY MANIPULATION change or modify a value of an existing array #array_pop(): Array Pop removes the last item from an array and returns it. #array_shift(): Array Shift removes the first item from an array and returns it. #array_push(): Add new data at the end of the Array. #array_unshift(): Add new data at the […]

Variable Scope In PHP: In Brief

Variable scope is a boundary for a variable within which it can be visible or accessed from code. There are only two scopes available in PHP namely local and global scopes. Local variables (local scope) Global variables (special global scope) Static variables (local scope) Function parameters (local scope) #STATIC SCOPE

Number formatting in JavaScript

There are many different ways of printing an integer with a comma as a thousand separators in JavaScript. One of the simplest ways is to use String.prototype.replace() function with the following arguments: regular expression: (?=(\d{3})+(?!\d)) replacement value: $1, This will also work for decimal numbers   Currency Formatting This method will also work with currency […]

Operator Precedence In PHP

The precedence of an operator specifies how “tightly” it binds two expressions together. For example, in the expression 1 + 5 * 3, the answer is 16 and not 18 because the multiplication (“*”) operator has higher precedence than the addition (“+”) operator. ***Parentheses may be used to force precedence, if necessary. For instance: (1 […]