- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Alok Prasad has Published 52 Articles
Alok Prasad
9K+ Views
Dependency injection is a procedure where one object supplies the dependencies of another object. Dependency Injection is a software design approach that allows avoiding hard-coding dependencies and makes it possible to change the dependencies both at runtime and compile time.There are numerous approaches to inject objects, here are couple generally ... Read More
Alok Prasad
317 Views
Yes, there are several advantages to using the magic function __construct() instead of the class's name. Those are listed below −The magic function __construct is introduced in PHP 5.4. One advantage of using __construct() over ClassName() as a constructor is if you change the name of the class, you don't ... Read More
Alok Prasad
281 Views
Sanitizing of inputs is an interesting concept in PHP. Sanitizing means escaping the unauthorized characters in the input. Let's learn some best practices to process the inputs in a safe and secure way.Use of real_escape_string() funnction in mysqli statements.Examplewe can use htmlentities() and html_entity_decode() while insert data in database and ... Read More
Alok Prasad
4K+ Views
GZIP Compression is a simple, effective way to save bandwidth and speed up PHP application. The mechanism runs behind the GZIP compression is described below −Step1The browser/client request for a file to the server.Step2The server sends a .zip file to the browser (index.html.zip) rather than plain old index.html in response, ... Read More
Alok Prasad
3K+ Views
Singleton Pattern ensures that a class has only one instance and provides a global point to access it. It ensures that only one object is available all across the application in a controlled state. Singleton pattern provides a way to access its only object which can be accessed directly without ... Read More
Alok Prasad
4K+ Views
PHP 7 has added a new operator double question mark (??) operator. In PHP 7, the double question mark(??) operator known as Null Coalescing Operator.It returns its first operand if it exists and is not NULL; otherwise, it returns its second operand. It evaluates from left to right. Null Coalescing ... Read More
Alok Prasad
2K+ Views
We can remove non-alphanumeric characters from the string with preg_replace() function in PHP. The preg_replace() function is an inbuilt function in PHP which is used to perform a regular expression for search and replace the content.syntaxpreg_replace(pattern, replacement, subject, limit, count )Let's discuss the parameters of the function underneath.patternThis parameter contains ... Read More
Alok Prasad
3K+ Views
Output Buffering is a method to tell the PHP engine to hold the output data before sending it to the browser. As we know PHP sent the output data to the browser in pieces, but if we utilize the output buffering mechanism, the output data is stored in a variable ... Read More
Alok Prasad
8K+ Views
In this article, we will learn to validate an email with PHP regular expression. We will learn different methods to validate email address in PHP.Method1The function preg_match() checks the input matching with patterns using regular expressions.Example Live DemoOutputValid email address.In the above example PHP preg_match() function has been used to search ... Read More