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 need a recipe app in php, Recipe App in PHP We are looking for a highl...

Recipe App in PHP We are looking for a highly talented PHP Coder for the development of a Recipe App for Mocktail. Need Strong Facebook Integration like General Signup with F

Textarea element in a form, Set the element's dimensions using row & column...

Set the element's dimensions using row & column attributes in the textarea tag so the data entered is easily viewable.  The element of course requires an appropriately descriptive

Jquery animations for website help needed, Finish JQuery Animations for Web...

Finish JQuery Animations for Website I am seeking a resources in the US that can work US hours ASAP to finish a couple JQuery animations for our website. The animations are pret

Explain pass by-reference, The expressions can be passed as pass by-referen...

The expressions can be passed as pass by-reference arguments or only variables can be passed? Only variables can be passed as pass by-reference.

I need a one webpage coming soon, I need a one webpage Coming Soon I wou...

I need a one webpage Coming Soon I would like one page design to so message like coming soon. a) Left Video player I provide you the code. b) Right Contact info c) Face

We need help in simple, We need help in Simple, Member-Based Fan Club Site ...

We need help in Simple, Member-Based Fan Club Site I play in an alternative-rock band as well as I am looking for someone to build a member-based website for our fan club. We do

I need a continuing education website, I need a Continuing Education Websit...

I need a Continuing Education Website Please see attached PDF for job specifications. We will be selecting a freelancer within the next week if one meets our needs and budget. T

I need help to create a unique website, I need help to create a unique webs...

I need help to create a unique website I'm seeking a programmer with experience in PHP, Javascript as well as Jquery, MySql. I have most of the script ready as well as need a li

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 (

Html headers, These are used to indicate the headings of sections or sub-se...

These are used to indicate the headings of sections or sub-sections in document. Based on the desired size of the text, any of six obtainable levels ( to ) of h

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