SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Top 20 php interview questions and 
answers 
If you need top 7 free ebooks below for your job interview, please visit: 
4career.net 
• Free ebook: 75 interview questions and answers 
• Top 12 secrets to win every job interviews 
• 13 types of interview quesitons and how to face them 
• Top 8 interview thank you letter samples 
• Top 7 cover letter samples 
• Top 8 resume samples 
• Top 15 ways to search new jobs 
Interview questions and answers – free pdf download Page 1 of 30
Tell me about yourself? 
This is probably the most asked 
question in php interview. It breaks the 
ice and gets you to talk about 
something you should be fairly 
comfortable with. Have something 
prepared that doesn't sound rehearsed. 
It's not about you telling your life story 
and quite frankly, the interviewer just 
isn't interested. Unless asked to do so, 
stick to your education, career and 
current situation. Work through it 
chronologically from the furthest back 
to the present. 
Interview questions and answers – free pdf download Page 2 of 30
What's PHP ? 
The PHP Hypertext Preprocessor is a 
programming language that allows web 
developers to create dynamic content 
that interacts with databases. PHP is 
basically used for developing web 
based software applications. 
Interview questions and answers – free pdf download Page 3 of 30
What Can You Do for Us That Other Candidates 
Can't? 
What makes you unique? This 
will take an assessment of 
your experiences, skills and 
traits. Summarize concisely: 
"I have a unique combination 
of strong technical skills, and 
the ability to build strong 
customer relationships. This 
allows me to use my 
knowledge and break down 
information to be more user-friendly." 
Interview questions and answers – free pdf download Page 4 of 30
What Is a Session? 
A session is a logical object created by 
the PHP engine to allow you to 
preserve data across subsequent HTTP 
requests. 
There is only one session object 
available to your PHP scripts at any 
time. Data saved to the session by a 
script can be retrieved by the same 
script or another script when requested 
from the same visitor. 
Sessions are commonly used to store 
temporary data to allow multiple PHP 
pages to offer a complete functional 
transaction for the same visitor. 
Interview questions and answers – free pdf download Page 5 of 30
What Is a Persistent Cookie? 
A persistent cookie is a cookie which is 
stored in a cookie file permanently on the 
browser's computer. By default, cookies are 
created as temporary cookies which stored 
only in the browser's memory. When the 
browser is closed, temporary cookies will be 
erased. You should decide when to use 
temporary cookies and when to use 
persistent cookies based on their 
differences: 
*Temporary cookies can not be used for 
tracking long-term information. 
*Persistent cookies can be used for tracking 
long-term information. 
*Temporary cookies are safer because no 
programs other than the browser can access 
them. 
*Persistent cookies are less secure because 
users can open cookie files see the cookie 
values. 
Interview questions and answers – free pdf download Page 6 of 30
How To Get the Uploaded File Information in the 
Receiving Script? 
Once the Web server received the uploaded file, 
it will call the PHP script specified in the form 
action attribute to process them. This receiving 
PHP script can get the uploaded file information 
through the predefined array called $_FILES. 
Uploaded file information is organized in 
$_FILES as a two-dimensional array as: 
$_FILES[$fieldName]['name'] - The Original 
file name on the browser system. 
$_FILES[$fieldName]['type'] - The file type 
determined by the browser. 
$_FILES[$fieldName]['size'] - The Number of 
bytes of the file content. 
$_FILES[$fieldName]['tmp_name'] - The 
temporary filename of the file in which the 
uploaded file was stored on the server. 
$_FILES[$fieldName]['error'] - The error code 
associated with this file upload. 
The $fieldName is the name used in the 
<INPUT TYPE=FILE, NAME=fieldName>. 
Interview questions and answers – free pdf download Page 7 of 30
How can I execute a PHP script using command 
line? 
Just run the PHP CLI (Command Line 
Interface) program and provide the 
PHP script file name as the command 
line argument. For example, "php 
myScript.php", assuming "php" is the 
command to invoke the CLI program. 
Be aware that if your PHP script was 
written for the Web CGI interface, it 
may not execute properly in 
command line environment. 
Interview questions and answers – free pdf download Page 8 of 30
What is the functionality of the functions 
STRSTR() and STRISTR()? 
string strstr ( string haystack, string 
needle ) returns part of haystack string 
from the first occurrence of needle to 
the end of haystack. This function is 
case-sensitive. 
stristr() is idential to strstr() except that 
it is case insensitive. 
Interview questions and answers – free pdf download Page 9 of 30
Would you initialize your strings with single 
quotes or double quotes? 
Since the data inside the single-quoted 
string is not parsed for variable 
substitution, it’s always a better idea 
speed-wise to initialize a string with 
single quotes, unless you specifically 
need variable substitution. 
Interview questions and answers – free pdf download Page 10 of 30
What is the difference between the functions 
unlink and unset? 
unlink() is a function for file system 
handling. It will simply delete the file in 
context. 
unset() is a function for variable 
management. It will make a variable 
undefined. 
Interview questions and answers – free pdf download Page 11 of 30
How can we submit form without a submit 
button? 
We can use a simple JavaScript code 
linked to an event trigger of any form field. 
In the JavaScript code, we can call the 
document.form.submit() function to submit 
the form. For example: <input type=button 
value="Save" 
onClick="document.form.submit()"> 
Interview questions and answers – free pdf download Page 12 of 30
What’s the output of the ucwords function in 
this example? 
$formatted = 
ucwords("TECHPREPARATIONS 
IS COLLECTION OF 
INTERVIEW QUESTIONS"); 
print $formatted; 
What will be printed is 
TECHPREPARATIONS IS 
COLLECTION OF INTERVIEW 
QUESTIONS. 
ucwords() makes every first letter 
of every word capital, but it does 
not lower-case anything else. To 
avoid this, and get a properly 
formatted string, it’s worth using 
strtolower() first. 
Interview questions and answers – free pdf download Page 13 of 30
So if md5() generates the most secure hash, why 
would you ever use the less secure crc32() and 
sha1()? 
Crypto usage in PHP is simple, but that doesn’t 
mean it’s free. First off, depending on the data that 
you’re encrypting, you might have reasons to store a 
32-bit value in the database instead of the 160-bit 
value to save on space. Second, the more secure the 
crypto is, the longer is the computation time to 
deliver the hash value. A high volume site might be 
significantly slowed down, if frequent md5() 
generation is required. 
Interview questions and answers – free pdf download Page 14 of 30
How can we know the count/number of elements of 
an array? 
2 ways: 
a) sizeof($array) - This function is an alias of 
count() 
b) count($urarray) - This function returns the 
number of elements in an array. 
Interestingly if you just pass a simple var 
instead of an array, count() will return 1. 
Interview questions and answers – free pdf download Page 15 of 30
How many ways we can pass the variable 
through the navigation between the pages? 
At least 3 ways: 
1. Put the variable into session in the 
first page, and get it back from session 
in the next page. 
2. Put the variable into cookie in the 
first page, and get it back from the 
cookie in the next page. 
3. Put the variable into a hidden form 
field, and get it back from the form in 
the next page. 
Interview questions and answers – free pdf download Page 16 of 30
What is the difference between CHAR and 
VARCHAR data types? 
CHAR is a fixed length data type. 
CHAR(n) will take n characters of 
storage even if you enter less than n 
characters to that column. For example, 
"Hello!" will be stored as "Hello! " in 
CHAR(10) column. 
VARCHAR is a variable length data 
type. VARCHAR(n) will take only the 
required storage for the actual number 
of characters entered to that column. 
For example, "Hello!" will be stored as 
"Hello!" in VARCHAR(10) column. 
Interview questions and answers – free pdf download Page 17 of 30
Can we use include(abc.PHP) two times in a PHP 
page makeit.PHP”? 
Yes we can include that many times we 
want, but here are some things to make 
sure of: 
(including abc.PHP, the file names are 
case-sensitive) 
there shouldn't be any duplicate 
function names, means there should not 
be functions or classes or variables with 
the same name in abc.PHP and 
makeit.php 
Interview questions and answers – free pdf download Page 18 of 30
What is the difference between PHP4 and PHP5? 
PHP4 cannot support oops concepts and 
Zend engine 1 is used. 
PHP5 supports oops concepts and Zend 
engine 2 is used. 
Error supporting is increased in PHP5. 
XML and SQLLite will is increased in 
PHP5. 
Interview questions and answers – free pdf download Page 19 of 30
What is the functionality of the function 
htmlentities? 
htmlentities() - Convert all applicable 
characters to HTML entities 
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. 
Interview questions and answers – free pdf download Page 20 of 30
What types of images that PHP supports ? 
Using imagetypes() function to find out 
what types of images are supported in 
your PHP engine. 
imagetypes() - Returns the image types 
supported. 
This function returns a bit-field 
corresponding to the image formats 
supported by the version of GD linked 
into PHP. The following bits are 
returned, IMG_GIF | IMG_JPG | 
IMG_PNG | IMG_WBMP | 
IMG_XPM. 
Interview questions and answers – free pdf download Page 21 of 30
Useful job interview materials: 
If you need top free ebooks below for your job interview, please visit: 
4career.net 
• Free ebook: 75 interview questions and answers 
• Top 12 secrets to win every job interviews 
• Top 36 situational interview questions 
• 440 behavioral interview questions 
• 95 management interview questions and answers 
• 30 phone interview questions 
• Top 8 interview thank you letter samples 
• 290 competency based interview questions 
• 45 internship interview questions 
• Top 7 cover letter samples 
• Top 8 resume samples 
• Top 15 ways to search new jobs 
Interview questions and answers – free pdf download Page 22 of 30
Top 6 tips for job interview 
Interview questions and answers – free pdf download Page 23 of 30
Tip 1: Do your homework 
You'll likely be asked difficult questions 
during the interview. Preparing the list of 
likely questions in advance will help you 
easily transition from question to question. 
Spend time researching the company. Look 
at its site to understand its mission statement, 
product offerings, and management team. A 
few hours spent researching before your 
interview can impress the hiring manager 
greatly. Read the company's annual report 
(often posted on the site), review the 
employee's LinkedIn profiles, and search the 
company on Google News, to see if they've 
been mentioned in the media lately. The 
more you know about a company, the more 
you'll know how you'll fit in to it. 
Ref material: 4career.net/job-interview-checklist- 
40-points 
Interview questions and answers – free pdf download Page 24 of 30
Tip 2: First impressions 
When meeting someone for the first time, we 
instantaneously make our minds about various aspects of 
their personality. 
Prepare and plan that first impression long before you 
walk in the door. Continue that excellent impression in 
the days following, and that job could be yours. 
Therefore: 
· Never arrive late. 
· Use positive body language and turn on your 
charm right from the start. 
· Switch off your mobile before you step into the 
room. 
· Look fabulous; dress sharp and make sure you look 
your best. 
· Start the interview with a handshake; give a nice 
firm press and then some up and down movement. 
· Determine to establish a rapport with the 
interviewer right from the start. 
· Always let the interviewer finish speaking before 
giving your response. 
· Express yourself fluently with clarity and 
precision. 
Useful material: 4career.net/top-10-elements-to-make-a- 
Interview questions and answers – free pdf download Page 25 of 30
good-first-impression-at-a-job-interview 
Tip 3: The “Hidden” Job Market 
Many of us don’t recognize that hidden job 
market is a huge one and accounts for 2/3 
of total job demand from enterprises. This 
means that if you know how to exploit a 
hidden job market, you can increase your 
chance of getting the job up to 300%. 
In this section, the author shares his 
experience and useful tips to exploit hidden 
job market. 
Here are some sources to get penetrating 
into a hidden job market: Friends; Family; 
Ex-coworkers; Referral; HR communities; 
Field communities; Social networks such 
as Facebook, Twitter…; Last recruitment 
ads from recruiters; HR emails of potential 
recruiters… 
Interview questions and answers – free pdf download Page 26 of 30
Tip 4: Do-It-Yourself Interviewing Practice 
There are a number of ways to prepare 
for an interview at home without the 
help of a professional career counselor 
or coach or a fee-based service. 
You can practice interviews all by 
yourself or recruit friends and family to 
assist you. 
Useful material: 4career.net/free-ebook- 
75-interview-questions-and-answers 
Interview questions and answers – free pdf download Page 27 of 30
Tip 5: Ask questions 
Do not leave the interview without 
ensuring that you know all that you 
want to know about the position. Once 
the interview is over, your chance to 
have important questions answered has 
ended. Asking questions also can show 
that you are interested in the job. Be 
specific with your questions. Ask about 
the company and the industry. Avoid 
asking personal questions of the 
interviewer and avoid asking questions 
pertaining to politics, religion and the 
like. 
Ref material: 4career.net/25-questions-to- 
ask-employers-during-your-job-interview 
Interview questions and answers – free pdf download Page 28 of 30
Tip 6: Follow up and send a thank-you note 
Following up after an interview can 
help you make a lasting impression and 
set you apart from the crowd. 
Philip Farina, CPP, a security career 
expert at Manta Security Management 
Recruiters, says: "Send both an email as 
well as a hard-copy thank-you note, 
expressing excitement, qualifications 
and further interest in the position. 
Invite the hiring manager to contact you 
for additional information. This is also 
an excellent time to send a strategic 
follow-up letter of interest." 
Ref material: 4career.net/top-8- 
interview-thank-you-letter-samples 
Interview questions and answers – free pdf download Page 29 of 30
Interview questions and answers – free pdf download Page 30 of 30

Weitere ähnliche Inhalte

Andere mochten auch

Php interview questions
Php interview questionsPhp interview questions
Php interview questionssekar c
 
Object oreinted php | OOPs
Object oreinted php | OOPsObject oreinted php | OOPs
Object oreinted php | OOPsRavi Bhadauria
 
Beginners Guide to Object Orientation in PHP
Beginners Guide to Object Orientation in PHPBeginners Guide to Object Orientation in PHP
Beginners Guide to Object Orientation in PHPRick Ogden
 
Computer relative short from....
Computer relative short from....Computer relative short from....
Computer relative short from....Nimai Chand Das
 
Angular 2 interview questions and answers
Angular 2 interview questions and answersAngular 2 interview questions and answers
Angular 2 interview questions and answersAnil Singh
 
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01Tekblink Jeeten
 
Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1Vikas Chauhan
 
29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview QuestionsArc & Codementor
 
20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental PrinciplesIntro C# Book
 
Full form of hardware and networking devices and terminology
Full form of hardware and networking devices and terminologyFull form of hardware and networking devices and terminology
Full form of hardware and networking devices and terminologyRavi Kodoli
 

Andere mochten auch (17)

General OOP Concepts
General OOP ConceptsGeneral OOP Concepts
General OOP Concepts
 
Php interview questions
Php interview questionsPhp interview questions
Php interview questions
 
Object oreinted php | OOPs
Object oreinted php | OOPsObject oreinted php | OOPs
Object oreinted php | OOPs
 
Beginners Guide to Object Orientation in PHP
Beginners Guide to Object Orientation in PHPBeginners Guide to Object Orientation in PHP
Beginners Guide to Object Orientation in PHP
 
Oop concepts
Oop conceptsOop concepts
Oop concepts
 
Oop concepts
Oop conceptsOop concepts
Oop concepts
 
Computer relative short from....
Computer relative short from....Computer relative short from....
Computer relative short from....
 
PHP Classes and OOPS Concept
PHP Classes and OOPS ConceptPHP Classes and OOPS Concept
PHP Classes and OOPS Concept
 
General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]
 
Angular 2 interview questions and answers
Angular 2 interview questions and answersAngular 2 interview questions and answers
Angular 2 interview questions and answers
 
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
 
Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1
 
DML Commands
DML CommandsDML Commands
DML Commands
 
29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions
 
20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
Full form of hardware and networking devices and terminology
Full form of hardware and networking devices and terminologyFull form of hardware and networking devices and terminology
Full form of hardware and networking devices and terminology
 

Kürzlich hochgeladen

Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 

Kürzlich hochgeladen (20)

Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 

Top php interview questions and answers job interview tips

  • 1. Top 20 php interview questions and answers If you need top 7 free ebooks below for your job interview, please visit: 4career.net • Free ebook: 75 interview questions and answers • Top 12 secrets to win every job interviews • 13 types of interview quesitons and how to face them • Top 8 interview thank you letter samples • Top 7 cover letter samples • Top 8 resume samples • Top 15 ways to search new jobs Interview questions and answers – free pdf download Page 1 of 30
  • 2. Tell me about yourself? This is probably the most asked question in php interview. It breaks the ice and gets you to talk about something you should be fairly comfortable with. Have something prepared that doesn't sound rehearsed. It's not about you telling your life story and quite frankly, the interviewer just isn't interested. Unless asked to do so, stick to your education, career and current situation. Work through it chronologically from the furthest back to the present. Interview questions and answers – free pdf download Page 2 of 30
  • 3. What's PHP ? The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications. Interview questions and answers – free pdf download Page 3 of 30
  • 4. What Can You Do for Us That Other Candidates Can't? What makes you unique? This will take an assessment of your experiences, skills and traits. Summarize concisely: "I have a unique combination of strong technical skills, and the ability to build strong customer relationships. This allows me to use my knowledge and break down information to be more user-friendly." Interview questions and answers – free pdf download Page 4 of 30
  • 5. What Is a Session? A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests. There is only one session object available to your PHP scripts at any time. Data saved to the session by a script can be retrieved by the same script or another script when requested from the same visitor. Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor. Interview questions and answers – free pdf download Page 5 of 30
  • 6. What Is a Persistent Cookie? A persistent cookie is a cookie which is stored in a cookie file permanently on the browser's computer. By default, cookies are created as temporary cookies which stored only in the browser's memory. When the browser is closed, temporary cookies will be erased. You should decide when to use temporary cookies and when to use persistent cookies based on their differences: *Temporary cookies can not be used for tracking long-term information. *Persistent cookies can be used for tracking long-term information. *Temporary cookies are safer because no programs other than the browser can access them. *Persistent cookies are less secure because users can open cookie files see the cookie values. Interview questions and answers – free pdf download Page 6 of 30
  • 7. How To Get the Uploaded File Information in the Receiving Script? Once the Web server received the uploaded file, it will call the PHP script specified in the form action attribute to process them. This receiving PHP script can get the uploaded file information through the predefined array called $_FILES. Uploaded file information is organized in $_FILES as a two-dimensional array as: $_FILES[$fieldName]['name'] - The Original file name on the browser system. $_FILES[$fieldName]['type'] - The file type determined by the browser. $_FILES[$fieldName]['size'] - The Number of bytes of the file content. $_FILES[$fieldName]['tmp_name'] - The temporary filename of the file in which the uploaded file was stored on the server. $_FILES[$fieldName]['error'] - The error code associated with this file upload. The $fieldName is the name used in the <INPUT TYPE=FILE, NAME=fieldName>. Interview questions and answers – free pdf download Page 7 of 30
  • 8. How can I execute a PHP script using command line? Just run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument. For example, "php myScript.php", assuming "php" is the command to invoke the CLI program. Be aware that if your PHP script was written for the Web CGI interface, it may not execute properly in command line environment. Interview questions and answers – free pdf download Page 8 of 30
  • 9. What is the functionality of the functions STRSTR() and STRISTR()? string strstr ( string haystack, string needle ) returns part of haystack string from the first occurrence of needle to the end of haystack. This function is case-sensitive. stristr() is idential to strstr() except that it is case insensitive. Interview questions and answers – free pdf download Page 9 of 30
  • 10. Would you initialize your strings with single quotes or double quotes? Since the data inside the single-quoted string is not parsed for variable substitution, it’s always a better idea speed-wise to initialize a string with single quotes, unless you specifically need variable substitution. Interview questions and answers – free pdf download Page 10 of 30
  • 11. What is the difference between the functions unlink and unset? unlink() is a function for file system handling. It will simply delete the file in context. unset() is a function for variable management. It will make a variable undefined. Interview questions and answers – free pdf download Page 11 of 30
  • 12. How can we submit form without a submit button? We can use a simple JavaScript code linked to an event trigger of any form field. In the JavaScript code, we can call the document.form.submit() function to submit the form. For example: <input type=button value="Save" onClick="document.form.submit()"> Interview questions and answers – free pdf download Page 12 of 30
  • 13. What’s the output of the ucwords function in this example? $formatted = ucwords("TECHPREPARATIONS IS COLLECTION OF INTERVIEW QUESTIONS"); print $formatted; What will be printed is TECHPREPARATIONS IS COLLECTION OF INTERVIEW QUESTIONS. ucwords() makes every first letter of every word capital, but it does not lower-case anything else. To avoid this, and get a properly formatted string, it’s worth using strtolower() first. Interview questions and answers – free pdf download Page 13 of 30
  • 14. So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()? Crypto usage in PHP is simple, but that doesn’t mean it’s free. First off, depending on the data that you’re encrypting, you might have reasons to store a 32-bit value in the database instead of the 160-bit value to save on space. Second, the more secure the crypto is, the longer is the computation time to deliver the hash value. A high volume site might be significantly slowed down, if frequent md5() generation is required. Interview questions and answers – free pdf download Page 14 of 30
  • 15. How can we know the count/number of elements of an array? 2 ways: a) sizeof($array) - This function is an alias of count() b) count($urarray) - This function returns the number of elements in an array. Interestingly if you just pass a simple var instead of an array, count() will return 1. Interview questions and answers – free pdf download Page 15 of 30
  • 16. How many ways we can pass the variable through the navigation between the pages? At least 3 ways: 1. Put the variable into session in the first page, and get it back from session in the next page. 2. Put the variable into cookie in the first page, and get it back from the cookie in the next page. 3. Put the variable into a hidden form field, and get it back from the form in the next page. Interview questions and answers – free pdf download Page 16 of 30
  • 17. What is the difference between CHAR and VARCHAR data types? CHAR is a fixed length data type. CHAR(n) will take n characters of storage even if you enter less than n characters to that column. For example, "Hello!" will be stored as "Hello! " in CHAR(10) column. VARCHAR is a variable length data type. VARCHAR(n) will take only the required storage for the actual number of characters entered to that column. For example, "Hello!" will be stored as "Hello!" in VARCHAR(10) column. Interview questions and answers – free pdf download Page 17 of 30
  • 18. Can we use include(abc.PHP) two times in a PHP page makeit.PHP”? Yes we can include that many times we want, but here are some things to make sure of: (including abc.PHP, the file names are case-sensitive) there shouldn't be any duplicate function names, means there should not be functions or classes or variables with the same name in abc.PHP and makeit.php Interview questions and answers – free pdf download Page 18 of 30
  • 19. What is the difference between PHP4 and PHP5? PHP4 cannot support oops concepts and Zend engine 1 is used. PHP5 supports oops concepts and Zend engine 2 is used. Error supporting is increased in PHP5. XML and SQLLite will is increased in PHP5. Interview questions and answers – free pdf download Page 19 of 30
  • 20. What is the functionality of the function htmlentities? htmlentities() - Convert all applicable characters to HTML entities 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. Interview questions and answers – free pdf download Page 20 of 30
  • 21. What types of images that PHP supports ? Using imagetypes() function to find out what types of images are supported in your PHP engine. imagetypes() - Returns the image types supported. This function returns a bit-field corresponding to the image formats supported by the version of GD linked into PHP. The following bits are returned, IMG_GIF | IMG_JPG | IMG_PNG | IMG_WBMP | IMG_XPM. Interview questions and answers – free pdf download Page 21 of 30
  • 22. Useful job interview materials: If you need top free ebooks below for your job interview, please visit: 4career.net • Free ebook: 75 interview questions and answers • Top 12 secrets to win every job interviews • Top 36 situational interview questions • 440 behavioral interview questions • 95 management interview questions and answers • 30 phone interview questions • Top 8 interview thank you letter samples • 290 competency based interview questions • 45 internship interview questions • Top 7 cover letter samples • Top 8 resume samples • Top 15 ways to search new jobs Interview questions and answers – free pdf download Page 22 of 30
  • 23. Top 6 tips for job interview Interview questions and answers – free pdf download Page 23 of 30
  • 24. Tip 1: Do your homework You'll likely be asked difficult questions during the interview. Preparing the list of likely questions in advance will help you easily transition from question to question. Spend time researching the company. Look at its site to understand its mission statement, product offerings, and management team. A few hours spent researching before your interview can impress the hiring manager greatly. Read the company's annual report (often posted on the site), review the employee's LinkedIn profiles, and search the company on Google News, to see if they've been mentioned in the media lately. The more you know about a company, the more you'll know how you'll fit in to it. Ref material: 4career.net/job-interview-checklist- 40-points Interview questions and answers – free pdf download Page 24 of 30
  • 25. Tip 2: First impressions When meeting someone for the first time, we instantaneously make our minds about various aspects of their personality. Prepare and plan that first impression long before you walk in the door. Continue that excellent impression in the days following, and that job could be yours. Therefore: · Never arrive late. · Use positive body language and turn on your charm right from the start. · Switch off your mobile before you step into the room. · Look fabulous; dress sharp and make sure you look your best. · Start the interview with a handshake; give a nice firm press and then some up and down movement. · Determine to establish a rapport with the interviewer right from the start. · Always let the interviewer finish speaking before giving your response. · Express yourself fluently with clarity and precision. Useful material: 4career.net/top-10-elements-to-make-a- Interview questions and answers – free pdf download Page 25 of 30
  • 26. good-first-impression-at-a-job-interview Tip 3: The “Hidden” Job Market Many of us don’t recognize that hidden job market is a huge one and accounts for 2/3 of total job demand from enterprises. This means that if you know how to exploit a hidden job market, you can increase your chance of getting the job up to 300%. In this section, the author shares his experience and useful tips to exploit hidden job market. Here are some sources to get penetrating into a hidden job market: Friends; Family; Ex-coworkers; Referral; HR communities; Field communities; Social networks such as Facebook, Twitter…; Last recruitment ads from recruiters; HR emails of potential recruiters… Interview questions and answers – free pdf download Page 26 of 30
  • 27. Tip 4: Do-It-Yourself Interviewing Practice There are a number of ways to prepare for an interview at home without the help of a professional career counselor or coach or a fee-based service. You can practice interviews all by yourself or recruit friends and family to assist you. Useful material: 4career.net/free-ebook- 75-interview-questions-and-answers Interview questions and answers – free pdf download Page 27 of 30
  • 28. Tip 5: Ask questions Do not leave the interview without ensuring that you know all that you want to know about the position. Once the interview is over, your chance to have important questions answered has ended. Asking questions also can show that you are interested in the job. Be specific with your questions. Ask about the company and the industry. Avoid asking personal questions of the interviewer and avoid asking questions pertaining to politics, religion and the like. Ref material: 4career.net/25-questions-to- ask-employers-during-your-job-interview Interview questions and answers – free pdf download Page 28 of 30
  • 29. Tip 6: Follow up and send a thank-you note Following up after an interview can help you make a lasting impression and set you apart from the crowd. Philip Farina, CPP, a security career expert at Manta Security Management Recruiters, says: "Send both an email as well as a hard-copy thank-you note, expressing excitement, qualifications and further interest in the position. Invite the hiring manager to contact you for additional information. This is also an excellent time to send a strategic follow-up letter of interest." Ref material: 4career.net/top-8- interview-thank-you-letter-samples Interview questions and answers – free pdf download Page 29 of 30
  • 30. Interview questions and answers – free pdf download Page 30 of 30