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

Display ads as well as native ad server and advertiser, Display Ads as well...

Display Ads as well as Native Ad Server and Advertiser and Publisher Tools This project has two tasks- a) Build an ad-serving solution as well as analytics dashboard for disp

Standard internet protocol, FTP (File Transfer Protocol), a standard Intern...

FTP (File Transfer Protocol), a standard Internet protocol. This is the simplest way to exchange files among computers on the Internet. FTP is an application protocol which uses th

Web app on ruby on rails, WEB APP Laravel PHP, MongoDB, Python Flask, An...

WEB APP Laravel PHP, MongoDB, Python Flask, AngularJS, Celery or Gevent, Bootstrap, But I am likewise open to Ruby On Rails or other tech if reasoning is clear. Desired Skill

Explain sessions and cookies, Where is the sessions stored? Sessions ar...

Where is the sessions stored? Sessions are stored in server side & it is accessed by a unique id that is known as the session-id where each user-visitor is assigned when they a

What is the difference between print and printf(), What is the difference b...

What is the difference between echo, print and printf()? Echo is the basic type used to print out a string. It just illustrates the content of message written using it. It can

Develope web app built with php, I have a web app built with PHP//node.js/ ...

I have a web app built with PHP//node.js/ backbone /MySQL/kinetic.js/ jQuery/canvas, and I would like to consult with someone with substantial experience in mobile game development

We want a coder for magento, Magento 2 installation We want a coder that...

Magento 2 installation We want a coder that has already installed the last Magento 2 installation Zip file so can help us to understand how to do it on our server. Desired Sk

Need a custom type of input control which is a tree view, Jaspersoft: Custo...

Jaspersoft: Custom Input Control: Tree View For a fresh project we urgently need a custom type of Input Control which is a tree view. we have the subsequent table structure (

Need help to create a shopping cart, Create a shopping cart I have an in...

Create a shopping cart I have an incomplete shopping cart. The preceding expert didn't finish the project. He has done 70% of the work as well as then sent it to me. I would lik

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