Input Validation in PHP
One essential technique to protect your web site from users is input validation, which is an impressive term that doesn't mean much at all. The term simply means that you need to c
Read tutorialTHE TUTORIAL LIBRARY
One essential technique to protect your web site from users is input validation, which is an impressive term that doesn't mean much at all. The term simply means that you need to c
Read tutorialSQL Injection is a method in which an attacker inserts malicious code into queries that run on your database.
Read tutorialWhen writing object-oriented code, it is often customary to put each class in its own source file. The advantage of this is that it's much easier to find where a class is placed, a
Read tutorialUnlike most other data types, printing the object's id will usually not be interesting to you. Also, objects often refer to data that should have print semantics—for example, it
Read tutorialClass inheritance enables you to describe a parent-child relationship between classes. For example, you might have a base class Shape from which both Square and Circle derive. Howe
Read tutorialThe instanceof operator was added as syntactic sugar instead of the already existing is_a() built-in function (which is now deprecated). Unlike the latter, instanceof is used like
Read tutorialPHP supports two reserved class names that make it easier when writing OO applications. self:: refers to the current class and it is usually used to access static members, methods,
Read tutorialThe subject of polymorphism is probably the most important in OOP. Using classes and inheritance makes it easy to describe a real-life situation as opposed to just a collection of
Read tutorialSimilar to static properties, PHP supports declaring methods as static. What this means is that your static methods are part of the class and are not bound to any specific object i
Read tutorialClasses can declare properties. Each instance of the class (i.e., object) has its own copy of these properties. However, a class can also contain static properties. Unlike regular
Read tutorialAccess modifiers may also be used in conjunction with object methods, and the rules are the same:
Read tutorialA key paradigm in OOP is encapsulation and access protection of object properties (also referred to as member variables). Most common OO languages have three main access restrictio
Read tutorialOne example today. A better developer tomorrow.