Frequently Asked Interview Questions And Answers For PHP Freshers

50,000+ Students Trained, 19+ Our Offices, 18+ Courses Offered,

Job Guarantee + Job Satisfaction, 2000+ Company Tie Ups For Placements

PHP Interview Questions

PHP Technical Interview Questions

 
  1. 1.What is the full form of phpand what is the PHP?
Ans the full form of php is Hypertext Pre-processor. Php is server side scripting language and Its open source and freely available. PHP easily integrated with HTML,JsvaScript and other fount End Technologies.
  1. 2.Why PHP called as server side scripting language?
Ans: All PHP script are executed on server and send response back as HTMl as browser can only understand the HTML so due to all PHP code executed on server its called as server side scripted language
  1. 3.What is the use of var_export function in php?
Ans: var_export() gets structured information about the given variable. It is similar to var_dump()with one exception: the returned representation is valid PHP code with data type.
  1. 4.Describe the $_GET ,$_POST , $_REQUEST method in PHP ?
Ans: in the php, you can use the $_REQUEST variable to get the data from client.we can get server response using $_GET.$_POST,$_REQUEST. When we are using “get” method from the client that time we have to use $_GET method. And when we use “post ” that time we have to use $_POST.if we are not aware about client method we can use $_REQUEST, $_REQUEST supports both $_GET and $_POST.  
  1. 5.What is the Difference between Session and cookies in PHP ?
Ans:A cookie is a small file with the maximum size of 4KB that the web server stores on the client computer.Once a cookie has been set, all page requests that follow return the cookie name and value. <?php setcookie(cookie_name, cookie_value, [expiry_time], [cookie_path], [domain], [secure], [httponly]); ?> A session is a global variable stored on the server. Each session is assigned a unique id which is used to retrieve stored values. <?php session_start(); //start the PHP_session function if(isset($_SESSION[‘page_count’])) { $_SESSION[‘page_count’] += 1; } else { $_SESSION[‘page_count’] = 1; } echo ‘You are visitor number ‘ . $_SESSION[‘page_count’];   ?>
  1. 6.Explain the type of join in SQL?
Ans: we can use join when we want to get the data from more than one table these are the  Types of join
  1. Inner
  2. Outer
    1. Left
    2. Right
  • full
  1. cross
  1. 7.How many types of array in PHP ?
Ans: in PHP there are three types of Array as-  
  1. Associative
  2. Numeric
  • Multidimentional
  1. 8.What is the associative array in PHP ?
Ans :When key are use define and alphabetic it’s called as associative array
  1. 9.Example of multi dimentional array in PHP ?
Ans: Array inside array is called as multi dimensional array
  1. 10.Difference betweenarray_combineamdarray_merge in PHP?
Ans: Array_combine is combining the array like first become is key and second become value
  1. Array_merge both array merge in sequential way one after another and make it as single
  1. 11.Difference betweenarray_merge and array_merge_recursive in PHP?
Ans: In array_merge-  (if repetitive colums then replace first with second)
  1. In merge_recursive then if repetitive colums then make the inside array at there
  1. 12.What is array_chunk in PHP?
Ans: it use to devide array in multiple array.
  1. 13.Difference of implode and explode function in PHP?
Ans: we can convert array to string insing implode function. And we can convert string to array using explode function.
  1. 14.How we can use Email function in PHP ?
Ans: We can use mail function using send_mail() for sending email in php.
  1. 15.What is the use of array_sum and array_count function in PHP?
Ans: Count – all total values in array
  1. Sum of all value in array
  1. 16.Why we use header function in PHP?
Ans: we use header function in php for –
  1. Used to redirect from one page to another
  2. File download
  3. Refresh the page
  1. 17.What is the abstract class in PHP ?
Ans: abstract class is use to define the function without body  than we can implement it in child class.
  1. 18.Difference between abstract and interface in PHP?
Ans: interfaces need to be implement and it’s fully abstract We can define simple function with body part in abstract class. And we can use it through inheritance.
  1. 19.What is the Constructor in PHP?
Ans: Constructor are like as method but it cant return the value and it will be invoked when we create the object of that class.
  1. 20.What is the use of static keyword in PHP?
Ans: we can access static method or data member without creating an object.
  1. 21.What is the use of final Class in PHP ?
Ans: final class we can’t be inherit.  
  1. 22.What is MVC Pattern in PHP?
Ans: MVC is the application design pattern in which we can access any function of our application through the controller only.we can define database logic in model class and we can reuse it.  
DataBase Question:  
  1. 1.What is DBMS and RDBMS?
Ans: DBMS is database management system in which each table using sepratly but in RDBMS- Relational database management system in which EF.Coded has given rules that need to be follow. That called RDBMS.
  1. 2.What is the difference between Primarykey and foreign key in SQL?
Ans: Primary key will be usique field it’s value cant be duplate and it cant be null Where Foreign key is just reference of Primarykey to another tablen it can be multiple in single table.
  1. 3.What is Trigger SQL?
Ans: it’s Special type of StoredProcedure. It’s can be invoked after or before the DML commands.
  1. 4.What is View in SQL?
Ans: View is use to define database structure virtually.it use to increase the process of database operations.
  1. 5.What is the difference between Function and StoredProcedure in SQL?
Ans: Function always return something where storedprocedure can be return every time.We can use function within procedure but can’ t procedure within function.

Tips & Tricks

Latest Blog

How to Become a Good Designer?8th October, 2018

Graphic, Web, Animation, VFX, UI, UX There are plethora of options for a designer to make an amaz

Is Digital Marketing a Right Career For You?2nd October, 2018

Digital Marketing is an industry in itself that is growing rapidly since its inception. And since th

How to Become a Cyber Security Expert?1st October, 2018

One of the most thrilling jobs in the IT sector is becoming a cyber security expert. It holds exce

Market Demand for PHP in 2018 in India5th July, 2018

Why PHP as a Career Option? In PHP world, release of PHP 7 is a huge accomplishment. PHP languag

Career Path For UI Developer Who Works On HTML52nd April, 2018

The wireless mobile phone has taken a significant place in the business world. Business is moving to

Our Events

Gyanmanjari Institute Of Technology Industrial Visits on 30th June 2018

Gyanmanjari Institute Of Technology Industrial Visits on 30th June at TOPS Technologies TOPS Techno

Android, Laravel, Python, Java and iOS Workshop at TOPS Technology

Android, Laravel, Python, Java and iOS Workshop at TOPS Technology We are happy to share that once

Project Documentation Workshop at TOPS Technologies

Project Documentation Workshop TOPS Technologies have organized “Project documentation” worksho

Final Year Project Documentation Workshop

Final Year Project Documentation Workshop Project Documentation, Project Definition, project Submis

Industrial Visit in the month of March and April at TOPS Technologies

Industrial Visits in the month of March and April at TOPS Technologies TOPS Technologies always bel