PHP: Access control modifiers One of the fundamental principles in OOP(Object Oriented Programming) is ‘encapsulation‘. The idea is that you create cleaner and better code, if you restrict access to the data structures (properties) and methods in your objects. The access modifier is the most important feature of the OOP language and it…
What is the difference between htmlspecialchars and htmlentities PHP functions? htmlentities: This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities. htmlspecialchars: Some characters have special significance in HTML, and should be represented by HTML entities if they…
What is the difference between cookies and session? HTTP is a stateless protocol. That mean, that treats each request as an independent transaction that is unrelated to any previous request. So, how about the request we want to make frequently, like username or id? As you know, we could store our data in COOKIE.…
PHP.ini is a configuration file that is used to customize behavior of PHP at runtime. This enables you to easy administration in Apache web server using configuration files. The settings in which upload directory, register global variables, display errors, log errors, max uploading size setting, maximum time to execute a script, libraries available and…
PDO : PHP Data Object PDO is an acronym for PHP Data Objects. It is a database access layer providing a uniform method of access to multiple databases. Use of PDO : Let a suppose you need to connect your database to Oracle or IBM DB2 in your existing code(written in MySQL/PHP) or if you…
Virtual Hosts simply give you the ability to “host” more than one Website and domain on your computer. With a virtual host you can have separate local domain names for each of your Websites.for example, http://website1/ for one site and http://website2/ for another etc. When you type the URL for the Virtual Host in…