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

19 comments:

cambiasso0330 said...

Hi

Tks very much for post:

I like it and hope that you continue posting.

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

Source: Marketing interview questions

Best rgs
David

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.

supra siri said...
This comment has been removed by the author.
muthu juna said...

thank u sir

PHP Training in Chennai

Roshini Balu said...

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

Roshini RS 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

Emi Jackson 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.

mathew delport 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

mathew delport said...

Testing Training in Chennai

Its really awesome blog..If anyone wants to get Software Testing Training in Chennai visit FITA IT academy located at Chennai. Rated as No.1 Software Testing Training Institutes in Chennai

Software Testing Course in Chennai

dhanamlakshmi palu 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

sherlina halim said...

Pengen yang lebih seru ...
Ayo kunjungi www.asianbet77.com
Buktikan sendiri ..

Real Play = Real Money

- Bonus Promo Red Card pertandingan manapun .
- Bonus Mixparlay .
- Bonus Tangkasnet setiap hari .
- New Produk Sabung Ayam ( minimal bet sangat ringan ) .
- Referal 5 + 1 % ( seumur hidup ) .
- Cash Back up to 10 % .
- Bonus Royalty Rewards setiap bulan .

untuk Informasi lebih jelasnya silahkan hubungi CS kami :
- YM : op1_asianbet77@yahoo.com
- EMAIL : asianbet77@yahoo.com
- WHATSAPP : +63 905 213 7234
- WECHAT : asianbet_77
- SMS CENTER : +63 905 209 8162
- PIN BB : 2B4BB06A / 28339A41

Salam Admin ,
http://asianbet77.com/

Shashaa Tirupati said...

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

jhansi joe 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

Rohit P said...

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

Aruna Vamsi said...

Very interesting technical stuff of PHP interview questions and answers.

UMA MAHESWARI said...

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

UMA MAHESWARI said...

Thanks for sharing this information.
MQ training in chennai

Lenova Services said...

Thanks for sharing this valuable information.
lenovo laptop service center in chennai
lenovo thinkpad service center chennai
lenovo ideapad service center chennai

Iqbal Dlk said...

very useful blogs.
hotels near us consulate chennai
hotels near apollo hospital chennai

Post a Comment