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

Oops, implmentation

implmentation

Ftp service, FTP understands two basic file formats only. It classifies eve...

FTP understands two basic file formats only. It classifies every file either a binary file or a text file. A text file has a sequence of characters gather into lines. Though comput

I need wordpress plugin development, Project Description: We have a cust...

Project Description: We have a custom booking engine software, which also powers reasonable functionality websites. In order to improve capability offering of our website, we ar

Want a programmer to help update our website, Need a programmer to help upd...

Need a programmer to help update our website. Long-term work available I have an independent that worked on my website as well as has done a great job up until now. He has lost

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

Does udp provide any security feature for mip, Question: a) An applica...

Question: a) An application sends a message which is 3400 bytes long. It sends the data as one UDP datagram. The message is then transferred from a sender to a receiver over t

Complete php and html coding required for new jobs site, Complete php/ html...

Complete php/ html coding required for new jobs site I have subscribed the domain for a new UK jobs site. I really bought a crappy theme for it (can't name here; libel), anyw

I have two php projects that need to be completed, I have two projects that...

I have two projects that need to be completed Project 1: This website wouldn't be for me. I'm not seeking to profit from the work you do on this job. Just helping out a friend.

Develop a page where customers can order computer equipment, Assume your bo...

Assume your boss has asked you to develop a Web page from which customers can order online computer equipment. You have to collect the customer's name, address, age, phone number,

We need help in couponic customzation, We need help in COUPONIC CUSTOMZATIO...

We need help in COUPONIC CUSTOMZATION Need Customization of cuponic script with added modular functionality. I have purchased the script as well as the modules. The customizatio

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