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 help in referral program magento enterprise extension, Referral Progra...

Referral Program Magento Enterprise Extension We're seeking someone to develop a referral extension for our online jewelry store Required functionality: a) Members will ap

We need an expert help in web app development, We need an expert help in We...

We need an expert help in Web App Development I am starting a fresh specific web development project that will not be based on a CMS. I want the application to be based onlin

I need a recipe app in php, Recipe App in PHP We are looking for a highl...

Recipe App in PHP We are looking for a highly talented PHP Coder for the development of a Recipe App for Mocktail. Need Strong Facebook Integration like General Signup with F

How php statement is different from php script, How PHP statement is differ...

How PHP statement is different from PHP script? Difference between PHP script and PHP statement is that statements are set of instructions which tell PHP to perform an action.

We are looking for local programmer for programming, We are looking for Loc...

We are looking for Local programmer for programming work in a start-up In search of a highly skilled programmer in html, css, sql etc to work apart of a Perth startup. If you ar

Finalize migration joomla old to new, Finalize migration Joomla 1.5 to 2.5 ...

Finalize migration Joomla 1.5 to 2.5 I want developer to do migration of couple of component from joomla 1.5 to 2.5. The migration is by now beginning on local server. The

I am in need of php copyscape script expert, I am in need of PHP Copyscape ...

I am in need of PHP Copyscape Script expert Want a sample PHP script which sends text to Copyscape as well as fetches the result along with balance in XML. Desired Skills are

Explain best user interface design guidelines, Question: The best user ...

Question: The best user interface design guidelines are guidelines that given high level and widely applicable principles. A set of such guidelines is as follows: (i) Know

I need a buddypress expert for new user registration form, This is a contin...

This is a continuing project but I require the following initial changes to my site. Producing an automatic welcome email for new users to the buddypress inbox when user registe

We need to migration of our site to magento, We need to Migration of our si...

We need to Migration of our site to Magento (from Zen Cart) I work as a consultant and am currently converting one of my clients e-commerce stores from Zen Cart to Magento. W

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