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

Design a website in wordpress, Website using Wordpress I'm looking for s...

Website using Wordpress I'm looking for someone to design a website for me. I have example websites of what I'm looking for. Design Type: New Website Purpose of the Web

Need help for webshop migration, Webshop migration We need to migrate/mo...

Webshop migration We need to migrate/move the website rcfun.dk to a Magento solution as well as we are now looking for the right company that can do the job. The site is curr

Google apps engine content summary function enhancement, Google apps engine...

Google apps engine Content summary function enhancement Project Scope- a) Develop in Google App Engine (GAE) b) Develop with python c) Comply our system design d) Us

Xenforo add-on required, Project Description: I am seeking an add-on to ...

Project Description: I am seeking an add-on to be coded for the Xenforo forum software. The add-on would be a post pruning system that will be customized on a per-forum level. I

Seeking coding partner, Seeking Coding Partner I am a web designer looki...

Seeking Coding Partner I am a web designer looking for an ongoing partner to code simple websites. The work will be fairly infrequent however paid very well. Desired Skills a

Need developer for scientific experiment, Scientific Experiment This is ...

Scientific Experiment This is a small project for a scientific experiment connected to a fashion startup. What is required- A Website that describes a promotion campaign f

I want you to build a small google script, 200-1019 Rapportive API Google D...

200-1019 Rapportive API Google Doc Script I want you to build a small Google script that can be run inside of a Google doc. The script will do the following: 1) Read an em

Php database hlelp, I am working in php basic learner want to know how to c...

I am working in php basic learner want to know how to connect database

Textarea element in a form, Set the element's dimensions using row & column...

Set the element's dimensions using row & column attributes in the textarea tag so the data entered is easily viewable.  The element of course requires an appropriately descriptive

I want help for booking travel site, Booking Travel Site The flow of the...

Booking Travel Site The flow of the website must have entirely of the functionality of Orbitz.com using GDS integration directly with Sabre. The complete concept of the website

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