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

We need a php developer for website, SanaSana Website Ecommerce website ...

SanaSana Website Ecommerce website using MySQL, Magento, PHP. There is several customization required for themes. Data has by now been procured. Desired Skills are MySQL Admi

Need help in bespoke duty and vat and shipping, Opencart (MijoShop) dev -Be...

Opencart (MijoShop) dev -Bespoke Duty/Vat and shipping We have a client who trades wines which are whichever purchased to be shipped to the customer (as standard) OR purchased a

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

Protocols and services on internet, To work along with Internet and to use ...

To work along with Internet and to use its facilities we employ certain tools. For instance, Telnet is a tool that is used for logging on remote computers on the Internet. Let us d

Drupal flow of information among 5 main layers, Explain drupal flow Mainly...

Explain drupal flow Mainly, there are 5 important layers in Drupal where information flows, a. Data (Node, ETC) b. Modules c. Blocks and Menus d. User Permissions e. Template a.

Wordpress developer required for website, Wordpress developer required S...

Wordpress developer required Searching good wordpress developer or else team for long term and more projects we outsource our jobs to good freelancers and its regular jobs. a

Need help to fix cs-cart custom printing of tickets, CS-Cart Custom Printin...

CS-Cart Custom Printing of Tickets We have a cart run on CS-Cart. The shopping cart doesn't purchase items however purchases raffle tickets. What I want is after each order is p

We need to create integration tool to integrate vtiger, We need support to ...

We need support to Create integration tool to integrate vTiger and Xero We have a client solution demanding development to integrate vTiger CRM and Xero accounting. We want t

Need help-cakephp plugin needed to plot charts with nv3d.js, Cakephp plugin...

Cakephp plugin needed to plot charts with nv3d.js I have a database where I have pairs of date times and values. I want a cakephp plugin that permits me to plot them using nv3d.

Looking for a good programmer to work with my graphic design, I am looking ...

I am looking for a good programmer to work with my graphic design/illustrator on my team to actively blend animation with gameplay and create a fun, simple and easy, 2d iPhone gam

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