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

Port a psd web site to a complete worpress, Web site Port a PSD Web site...

Web site Port a PSD Web site to a complete Worpress, multilanguage web site. Wants to document how to create new pages Desired Skills MySQL Administration, HTML and PHP

Shopping Cart, Shopping Cart Purpose – Allows user to browse while keeping ...

Shopping Cart Purpose – Allows user to browse while keeping track of the items in which they will purchase at the end on the order page link and this will give a final price for al

Create a code for implement database of a car company, Creating Table cr...

Creating Table create table cars (Vin_num varchar(30),primary key(Vin_Num),Make varchar(15),Model varchar(20),Year int,Price varchar(20)); Inserting Records: insert into cars va

In search of experienced cake php coder to help in launch, In search of exp...

In search of experienced Cake PHP coder to help in launch of new site We are seeking someone to assist our small team of developers to handle minor code tweaks as well as error

Need help in google map interface, Need help in Google map interface Sum...

Need help in Google map interface Summary- Highpoint streets on Google maps using colours that depend on the score those streets receive in my data Details: I want to map fiv

Difference between b2c and b2b business strategies, Question: (a) A co...

Question: (a) A company would like to extend its business over the internet. List the needed steps for that to happen. (b) Describe, with the aid of examples, the differenc

Need help in duma ice website, Duma ICE Website I want to work in conjun...

Duma ICE Website I want to work in conjunction with a Wordpress developer to create a Wordpress website for Number of pages as well as content will be based on the existing ht

Select tag and pull down lists, The next type of input is a Pull down List....

The next type of input is a Pull down List. With this kind you ought to use rather than and it also contain a closing tag. This control is used while w

Expand websites in magento or drupal or wordpress, Looking to expand websit...

Looking to expand websites in Magento or Drupal or WordPress Looking for someone to design three websites 1) A Canadian based Restaurant with Twitter, Facebook marketing & SE

Need help interactive weather map using weather data api, Create Interactiv...

Create Interactive Weather Map using Weather Data API Looking for an experienced web developer to create an interactive weather map of the US using the Aeris API. Desired Ski

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