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

Social website, how to creat a register and login form

how to creat a register and login form

Want professional looking table in html / css, Want Professional Looking Ta...

Want Professional Looking Table in HTML / CSS Want an experienced HTML or CSS developer to create a table which we is able to use on several web pages and that can be edited ver

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

History object, This is a predefined JavaScript object that is accessible b...

This is a predefined JavaScript object that is accessible by the history property of a window object. The window. history property is array of URL strings that reflect the entries

Need help to make checkout page customisation, Checkout Page Customisation ...

Checkout Page Customisation 1) Clone process need to be exact same as the reference checkout site 2) Final product must be responsive to all devices Desired Skills are MyS

We need new responsive website, We need New Responsive Website (Wordpress "...

We need New Responsive Website (Wordpress "X - Ultimate Theme" Preferred) I would need a website designed for Hazelgrovehomes.com. The determination of the website is primarily

Magento expert wanted for a quick help, Magento Expert wanted for a quick j...

Magento Expert wanted for a quick job at ALRUG.com We are working on a new website founded on Magento for ALRUG.com, which is now located at ALRUG.com/beta running on Magento Co

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 needed php developer, Our company is looking for a brilliant PHP Develope...

Our company is looking for a brilliant PHP Developer to join our dynamic and young online media agency. Must have: - Knowledge in Databases and SQL, proven coding and indexin

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