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

I neeed help in cakephp project, I neeed help in CakePHP Project Good kn...

I neeed help in CakePHP Project Good knowledge of PHP. 1) Hands-on PHP based framework, Cake PHP 2) Demonstrable knowledge of web technologies including HTML, CSS, Javascript, A

Link documents in the site, Images in the top area of the Compass home page...

Images in the top area of the Compass home page guide visitors to specific pages on the site. Now you will add links for navigation buttons. You will see that there are a number

Website paypal integration, Website PayPal integration We have popular o...

Website PayPal integration We have popular of the site developed. We are looking to integrate our website payment system with PayPal. Seeking an experienced developer with PayPa

Web site on cake php to be redesigned, Web Site on Cake PHP to be redesigne...

Web Site on Cake PHP to be redesigned and Things to be added Project Description: We have a web site that has some finishing off and also fixing some bugs. We will consider I

I want help for booking travel site, Booking Travel Site The flow of the...

Booking Travel Site The flow of the website must have entirely of the functionality of Orbitz.com using GDS integration directly with Sabre. The complete concept of the website

We need help to develop online tax accounting software, We need help to dev...

We need help to develop Online Tax Accounting Software I am seeking a programmer and web designer who has experience to create a website where customers can log on to the websit

Redesign to travel website, Redesign to Travel Website - Design, SEO, Ease ...

Redesign to Travel Website - Design, SEO, Ease of Use Project Description: We are seeking a dedicated programming team to improve a travel website. To provide upgrades to the

I want to develop a discussion board and classifieds, I want to develop a D...

I want to develop a Discussion Board/Classifieds I'm seeking to create a discussion board/classifieds for the community I live in I do like to know what platform you'd use an

I need help to fix joomla bugs, I need help to fix Joomla Bugs I have a ...

I need help to fix Joomla Bugs I have a Joomla site (version 2.5.7) that has some minor issues. Needs fixed ASAP 1. We are feat error message on backend when trying to edit a

Programmer needed for editing existing websites, Programmer required for ed...

Programmer required for editing existing websites Current website network comprising- a) Responsive mobile website b) In-store website c) Manager website All three s

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