Differences between include(), require() and include_once(), PHP Web Programming

Assignment Help:

Question:

(a) What are the differences between include(), require() and include_once()?

(b) Convert the below if-elseif code to its equivalent switch case version:

$day = 'Wednesday';
if ($day == 'Monday') {
echo 'Wish you a fresh start!';
}
elseif ($day == 'Wednesday') {
echo 'Keep going. Good luck!';
}
elseif ($day == 'Friday') {
echo 'Happy weekend!';
}
else {
echo 'Good day!';
}

(c) Describe the two kinds of arrays supported by PHP and provide suitable code fragments to illustrate your answer?

(d) Write a function that returns the result of a basic arithmetic operation like addition, subtraction, multiplication and division based on two supplied operands passed as arguments. The function should accept two mandatory arguments, i.e. the first and second operands and a third optional argument for the operator (default operator value is addition).

(e) Consider the following PHP code:

for ($i=1; $i<=3; $i++)
{
for ($j=1; $j<=$i; $j++)
{
echo 'X';
}
echo '
';
}

The above code fragment uses a for loop construct to print out Output A. Using the While construct, rewrite the above code fragment to print out the same output.


Related Discussions:- Differences between include(), require() and include_once()

Seeking a five to six page content driven website, FF-Greek Dairy Website ...

FF-Greek Dairy Website Seeking a 5-6 Page Content driven website for a diary to feature products from the store, The aptitude to edit from the back-end any pictures and product

We want help in wordpress plugin development, We want help in WordPress Plu...

We want help in WordPress Plugin Development - Route Delivery Schedule We want a plugin that has the ability to display Delivery Schedules based on a location filter in a calend

#title: , Create the xhtml markup that produces the table shown below. Use ...

Create the xhtml markup that produces the table shown below. Use and tags as necessary. The camel.gif image can be downloaded from http://www.deitel.com/books/iw3htp4/

I need a three page website, I need a three page website I have a homepa...

I need a three page website I have a homepage as well as two internal page designs ready in fireworks. I want these three pages online by the weekend. More work if we discover a

Magento developer is required to audit and update a magento, Magento Develo...

Magento Developer is required to audit and update a Magento 1.702 website As we are quickly expanding ongoing work will be available for the right candidate. The ideal Magento D

Work in layout view, Dreamweaver contain two visual design views-Standard v...

Dreamweaver contain two visual design views-Standard view & Layout view. You'll begin by working in Layout view, which let you to draw layout cells or layout tables in which you ca

Custom feed creation on wordpress, Custom feed creation on wordpress Pro...

Custom feed creation on wordpress Project Description: Want a custom rss creation, without being the default wordpress, rss can pull data from custom fields and categories, b

How php statement is different from php script, How PHP statement is differ...

How PHP statement is different from PHP script? Difference between PHP script and PHP statement is that statements are set of instructions which tell PHP to perform an action.

Phpbb modifications for course type forum, PHPBB modifications (course type...

PHPBB modifications (course type forum) I want to create a different view/organization of the viewForum.php for my phpBB site. To support this change several changes needs to

We need magento experts needed, We need magento experts needed I am seek...

We need magento experts needed I am seeking Magento Expert only if you can start from right now and long time for my company in-house project's, If you can customize Magento the

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd