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

Need long-term php developer for e-commerce product, Need Long-term PHP dev...

Need Long-term PHP developer for e-commerce product I'm seeking to work with a PHP developer in the UK who has experience working with custom software such as e-commerce product

Need help to revamp an existing website, Website Designing Need help to ...

Website Designing Need help to revamp an existing website Job description: Need to change the look of an existing website so that it can have greater hits Web developme

Distinguish between complex type and simple type elements, Question: (a...

Question: (a) Explain the concept of "mixed content" in an XML document. What restrictions are placed on the definition of elements with mixed content by Document Type Defini

Help to create magento website for high end goods, Help to create Magento W...

Help to create Magento Website for High end goods Hello, please reply with a proposal that displays an plugins that may be needed that aren't standard with Magneto I am initi

I need help in php, I need help in PHP, Wordpress Developer - with Mixpanel...

I need help in PHP, Wordpress Developer - with Mixpanel I'm changing from using Aweber for email management to Mixpanel. I want you to grow a WordPress plugin that will allow

Write a php application, Write a Php application that is used to manage a r...

Write a Php application that is used to manage a restaurant business. Assume menu items, categories (appetizer, dessert ...etc), prices and descriptions. The Restaurant has 10 tabl

Need help to make api changes, Need help to make API changes a) All work...

Need help to make API changes a) All work submitted via github b) All time billed using workview Want adjustments to custom scripts for ebay APIs: a) Download part numb

Need help in responsive architectural portfolio, Responsive Architectural P...

Responsive Architectural Portfolio, HTML5 and jQuery We are seeking a new website to showcase our architectural projects. I have a good hint of exactly how I want the website

I need help to integrate api, I need help to Integrate API We want a cod...

I need help to Integrate API We want a coder to implement an API into our wordpress website. The API is well documented. This job is a high priority as well as must be fin

Design and create a php document, All functionality required for this assig...

All functionality required for this assignment must be achieved using PHP server side scripting. No browser side scripting is to be used. In assignment you created the initial u

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