PHP Notes

All keywords (e.g. if, else, while, echo, etc.), classes, functions, and user-defined functions are NOT case-sensitive, but all variable names are case-sensitive.

A variable starts with the $ sign, followed by the name of the variable
A variable name must start with a letter or the underscore character
A variable name cannot start with a number
A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
Variable names are case-sensitive ($age and $AGE are two different variables)

Continue reading “PHP Notes”

Understanding the “this” keyword in Javascript

The this keyword always refers to an object.

We can use it outside of any function in the global scope but most often it is used inside a function (otherwise known as a method, when the function is defined inside an object).

When it is used within a method, it refers to the object on which the method is being invoked.

Continue reading “Understanding the “this” keyword in Javascript”

CSS Centering

Horizontal centering.

When the element to be centered is an inline element we use text-align center on its parent.

When the element is a block level element we give it a width and set the left and right margins to a value of auto.

Vertical centering

The values for vertical-align have meaning with respect to a parent inline element.

Continue reading “CSS Centering”