Posts

Showing posts from December, 2019

CodeIgniter Interview Questions

CodeIgniter is an open-source MVC based framework for PHP. It is a loosely coupled framework that we can use for the rapid development of websites and mobile APIs. 1) How to check the version of the CodeIgniter framework? In system/core/CodeIgniter.php, check CI_VERSION constant value define(‘CI_VERSION’, ‘3.0.6’); 2) How to set CSRF token in CodeIgniter? CSRF is used to set the protection in CodeIgniter. To set CSRF, you have to put the corresponding config value True. Syntax: $config['csrf_protection'] = TRUE; 3) How many types of messages you can log in to CodeIgniter? There are three message types in Codeigniter. They are : Error Messages. These are actual errors, such as PHP errors or user errors. Debug Messages. These are messages that assist in debugging. For example, if a class has been initialized, you could log this as debugging info. Informational Messages. These are the lowest priority messages, simply giving information regarding some process.

Object Oriented Programming (OOPs) Concepts in PHP

Class -  Class is the template which contains class members. class members are properties and methods. Property - Variable declared within the class. Method - Function declared within the class. Object -  An object is the memory location of the class variables. We can access the class variables with the support of object. New -  By using this keyword we can allocate space in the new memory locations to load class content. Constructor -  The constructor is one the type of method which is having class name same as method name. By default, every class contains a default constructor used to load class constraints. In PHP we can use constructor in two ways - Using constructor keyword (default constructor) - __constructor(). Using class name - className(). Destructor -  Destructor is the special type of method, which can be executed at the time of destroying object of class. By using __destructor() we can create destructor. In PHP , the class objects w

Basic PHP Interview Questions?

1) What is PHP?  PHP is a server-side scripting language that is basically used for developing dynamic web pages.  2) What is the difference between echo( ) and print ( )? echo and print are more or less the same. They are both used to output data to the screen.The differences are small: echo has no return value while print has a return value of 1 so it can be used in expressions. echo can take multiple parameters while print can take one argument. echo is marginally faster than print.  3) What is print_r( )? This is also an output function used in PHP, It is used to display the whole array in PHP.  4) How to include files in PHP? We can include a file using "include( )" or "require( )" function with file path as its parameter. 5) What is the difference between GET and POST? We can send small data using GET method but POST method can transfer a large amount of data and POST is secure method than GET method.  7) How to declare an array in P