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()

Turn based business game, Turn Based Business Game I am engrossed in hav...

Turn Based Business Game I am engrossed in having a turn based strategy game created for small business owners - specifically at least initially in the lawn as well as landscape

We need help to create bitcoin poker room website, We need help to create B...

We need help to create Bitcoin poker room website Need a high end bitcoin poker flash site with option to android app/software Develop as well as design the website concept,

Programming, how to make a Content Management System

how to make a Content Management System

Web site in psd besides need it coded in html 5, HTML5 Web Site We have ...

HTML5 Web Site We have a web site in PSD besides need it coded in HTML 5 and CSS3 and put on our domain. 8 pages - 2 lightboxes - 3 forms We have a PSD required to be code

Need help in revisions to expression engine website, Revisions to Expressio...

Revisions to Expression Engine website I am handling a website created from Expression Engine framework and need a few revisions completed. I will attempt to describe the revisi

Add function in web app, Add function in web app Project Description: ...

Add function in web app Project Description: I buy simple web app from code canyon and i want to add one function to this app i want it in As soon as. Skills required are

Mail status, i m sending mails from my server via email panel made by me. i...

i m sending mails from my server via email panel made by me. i want to get its delivery status .... how to make it

Need help in data migration from pdg cart to magento, Data migration from P...

Data migration from PDG cart to Magento Job Description- I am seeking a Web Developer to migrate PDG shopping cart to Magento Your qualifications- a) Previous experienc

We need a analyst python programmer, We need a Analyst Programmer Our Es...

We need a Analyst Programmer Our Esteemed as well as Reputable Client is looking for an Analyst Programmer (Python) for their organization. The candidate is mandatory to perform

Set table properties, Now you will employ the table Property inspector to r...

Now you will employ the table Property inspector to remove the extra space within the navigation buttons table & to insert a background color in the table. 1. In the Property in

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