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

Crud application criteria, CRUD application criteria -Use a proper data...

CRUD application criteria -Use a proper data model, this means using Object Oriented PHP if you choose PHP -This model should have around 6-8 properties -The model should

What are the types of code declaration, Question: (a) What are the fou...

Question: (a) What are the four types of code declaration blocks you can use to write PHP? (b) Distinguish between the include() statement and the require() statement.

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

Need help for magazine wordpress website developer, Magazine WordPress Webs...

Magazine WordPress Website Developer We are seeking a talented WordPress developer to turn our mockups into a functioning WordPress website. The website will comprise the fol

Want a web programmer who understands conversion, Want a Web Programmer Who...

Want a Web Programmer Who Understands Conversion Want a developer who can get handed a site project as well as bring it to completion quickly. Steady work someone who is moti

We need help in the trigger svg animation when it is in view, We need help ...

We need help in the Trigger SVG animation when it is in view I am using Raphael as well as lazylinepainter to do svg animations. I don't want the animations to start until they

I need small cakephp project, I need Small CakePHP project Project Descr...

I need Small CakePHP project Project Description: I have an existing system built on CakePHP which requires some updates and development as well as some bug fixing. It is a u

Seeking for a javascript engineer, Looking for a JavaScript Engineer I a...

Looking for a JavaScript Engineer I am seeking for a JavaScript Engineer good at MeteorJS framework. I would like to have a prototype erected as below Users can register with

Want expert help in wordpress plugin development, Want expert help in Wordp...

Want expert help in Wordpress Plugin Development for Easy Digital Downloads We are utilizing a plugin called Easy Digital Downloads to allow clients to choose from selected file

Help with joomla-opencart problem, Help with Joomla/Opencart problem I h...

Help with Joomla/Opencart problem I have a website made on Joomla 2.5 using a component called AceShop (which is a bridge for Opencart). I have newly moved the website to a new

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