Pass an arguments to a function, PHP Web Programming

Assignment Help:

You can pass arguments to a function. These are variables, either strings or numbers, which are utilized inside the function. Certainly the output of the function based on the arguments you give it.

In the following instance we pass two arguments, the number 1 & the string 'house':

example(1,'house');

While these arguments arrive at the function, they are stored up in two variables, a & b. You ought to declare these in the function header, as you can look below.

function example(a,b)

<HTML>

<HEAD>

<TITLE>IGNOU </TITLE>

<SCRIPT Language = "JavaScript">

function example(a, b)

{

var number;

number += a ;

alert('You have chosen: ' + b);

}

</SCRIPT>

</HEAD>

<BODY>

<FORM NAME="selectForm">

<P><B>Click the button below:</B>

<BR>

<P><INPUT TYPE="button" VALUE="Click" onClick="example(1,'house')">

</FORM>

</BODY>

</HTML>

2095_Pass An arguments to a function.png

Figure: Using Functions

This adds one to number and displays "You have decided: house". Certainly, if you call the function like example (5,'palace'), then it adds five to number & displays "You have decided: palace". The output of the function based on the arguments you give it.


Related Discussions:- Pass an arguments to a function

Migrate and format content from old wp theme to new theme, Need help in mig...

Need help in migrate and format content from old WP theme to new (different) WP theme Seeking for a WP expert to migrate my old site's content from its current existing theme, t

We need to get info from website using javascript, We need to Get info from...

We need to Get info from website using javascript I want to excerpt the text from all the available (blue) seats of all the events on this site without getting banned. I already

Magento expert and developer to assists maintain site, Magento expert and d...

Magento expert and developer to assists maintain existing site Job is quite simple. We have a website built in Magento. We would like to appoint someone who will help to main

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

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

I need a wordpress expert, I Need a wordpress expert I am observing to e...

I Need a wordpress expert I am observing to establish a long term relationship with a WordPress expert. This is the first project which will have to be a basic theme website fro

Want help of seo for existing website, SEO FOR EXISTING WEBSITE We are i...

SEO FOR EXISTING WEBSITE We are in search of an expert who will do the SEO for an existing website. The website is hosted in a third party server not ours. The client wants his

Magento community with enterprise features on amazon aws, Magento community...

Magento community with Enterprise features on Amazon AWS We are concerned to run Multiple Magento community instances on Amazon AWS to support very high traffic. We as well like

Develop a new magento site, As we are establishing a new Magento site with ...

As we are establishing a new Magento site with several large extensions involved, this job is to resolve the various unexpected issues that can occur during set up and testing. As

Text-only web browsers, Text-only browsers: A text-only browser like Ly...

Text-only browsers: A text-only browser like Lynx let you to view Web pages without showing art or page structure. Fundamentally, you look at ASCII text onto a screen. The bene

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