PHP Interview Questions with Answers Part 5

on 5:14 AM

This is the new fifith episode of PHP Interview preparation Questions with answers. Check out this collection of PHP Interview Questions with simplified Answers.
  • How can we extract string 'abc.com ' from a string http://info@abc.com using regular expression of php?
  • What is the difference between the functions unlink and unset?
  • How come the code works, but doesn’t for two-dimensional array of mine?
  • How can we register the variables into a session?
  • What is the difference between characters \023 and \x23?
  • With a heredoc syntax, do I get variable substitution inside the heredoc contents?
  • How can we submit form without a submit button?
  • How can we create a database using PHP and mysql?
  • How many ways we can retrieve the date in result set of mysql using php?
  • Can we use include ("abc.php") two times in a php page "makeit.php"?
How can we extract string 'abc.com ' from a string http://info@abc.com using regular expression of php?

We can use the preg_match() function with "/.*@(.*)$/" as 
the regular expression pattern. For example: 
preg_match("/.*@(.*)$/","http://info@abc.com",$data);
echo $data[1];
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.
How come the code works, but doesn’t for two-dimensional array of mine?
Any time you have an array with more than one dimension, complex parsing syntax is required. print "Contents: {$arr[1][2]}" would’ve worked.
How can we register the variables into a session?
session_register($session_var);  $_SESSION['var'] = 'value';
What is the difference between characters \023 and \x23?
The first one is octal 23, the second is hex 23.
With a heredoc syntax, do I get variable substitution inside the heredoc contents?
Yes.
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:
How can we create a database using PHP and mysql?
We can create MySQL database with the use of mysql_create_db($databaseName) to create a database.
How many ways we can retrieve the date in result set of mysql using php?
As individual objects so single record or as a set or arrays.
Can we use include ("abc.php") two times in a php page "makeit.php"?
Yes.
For Previous Parts click below links

PHP Interview Questions with Answers Part 4

PHP Interview Questions with Answers Part 3

20 comments:

nolan said...

Hi

I read this post 2 times. It is very useful.

Pls try to keep posting.

Let me show other source that may be good for community.

Source: Amazon interview questions

Best regards
Jonathan.

Unknown said...
This comment has been removed by the author.
Unknown said...

Thanks for sharing this valuable information to our vision
Web design institutes in Chennai

Unknown said...

DOT NET Training in Chennai

I have read all the articles in your blog; was really impressed after reading it. FITA is glad
To inform you that; we provide practical training on all the technologies with MNC exports. We
Assure you that through our training the students will gain all the sufficient knowledge to have a voyage in IT industry.
FITA Reviews

Unknown said...

Hi, Thanks for sharing this valuable blog.I was really impressed by reading this blog. I did HTML5 Training in Chennai at reputed HTML5 Training Institutes in Chennai. This is reslly useful for me to make a bright future in designing field.

Unknown said...



Thanks for sharing this information. SEO is one of the digital marketing techniques which is used to increase website traffic and organic search results. If anyone wants to get SEO Course in Chennai visit FITA Academy located at Chennai. Rated as No.1 SEO Training institute in Chennai.

SEO Training in Chennai | SEO Training Institute in Chennai

Unknown said...

very nice !!! i have to learning a lot of information for this sites...Sharing for wonderful information. PHP Training in chennai | PHP Training chennai | PHP course in chennai | PHP course chennai

Unknown said...

That is an informative post. Thank you so much.
Shashaa
HTML5 Courses in Chennai | HTML5 Courses in Chennai

Unknown said...

This technical post helps me to improve my skills set, thanks for this wonder article I expect your upcoming blog, so keep sharing.
Regards,
cognos tm1 Training in Chennai|Python Training Institutes in Chennai|Node JS training

Unknown said...

That was very useful question on interview, thanks author, likewise also gain knowledge on seo seo training in bangalore

Unknown said...

Very interesting technical stuff of PHP interview questions and answers.

Unknown said...

This is really great news. Thank you for sharing it with us!
oracle dba training in chennai

Unknown said...

Thanks for sharing this information.
MQ training in chennai

Unknown said...

AWS is designed to allow application providers, ISVs, and vendors to quickly and securely host your applications. Credo Systemz provides the best AWS Training to get your certifications easily.

aws training in chennai with placement| aws authorized training partner in chennai|aws solution architect training in chennai

jefrin said...

Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
RPA Course Training in Chennai
AWS Training in Chennai | Best AWS Training in Chennai
Data Science Training in Chennai | Best Data Science Training in Chennai
No.1 Python Training in Chennai | Best Python Training in Chennai

Aparna said...


You are giving the post is too good and The content is very useful for me. Thanks for your brief explanation with sharing and Keep posting...!
Excel Training in Chennai
Advanced Excel Training in Chennai
Tableau Training in Chennai
Pega Training in Chennai
Oracle DBA Training in Chennai
Unix Training in Chennai
Power BI Training in Chennai
Oracle Training in Chennai
Excel Training in Chennai
Advanced Excel Training in Chennai

sathyaramesh said...

Great post and informative blog.it was awesome to read, thanks for sharing this great content to my vision.
Good discussion.
Cloud Computing Courses in Chennai
Cloud Computing Training in Chennai
Python Training in Chennai
RPA Training in Chennai
Software Testing Training in Chennai
Java Training in Chennai
Web Designing Course in chennai
Cloud Computing Training in Velachery

michael johnson said...

nice blogs...
internship for ece students in bangalore
internship for cse students in hyderabad
internship for cse students in hyderabad
artificial intelligence internship
internship in bangalore for be cse students
internship in pune for computer engineering students
free internship in chennai
internship
internship for bsc students
android training in chennai

IICT Technologies said...

Superb
SAP Training in Chennai
SAP ABAP Training in Chennai
SAP Basis Training in Chennai
SAP FICO Training in Chennai
SAP SD Training in Chennai
SAP MM Training in Chennai
SAP PM Training in Chennai
SAP PP Training in Chennai
SAP MDG Training in Chennai
SAP EHS Training in Chennai

divya said...

your blog information's are really creative and It contains full of new innovative ideas.thank you for sharing with us.please update more data. good jobs
Ai & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai

Post a Comment