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

What is the difference between $message and $$message, What is the differen...

What is the difference between $message and $$message? Main difference between $message and $$message is that former is a simple variable and later is a reference variable. $me

3d printing website or software written mainly in phython, 3D Printing webs...

3D Printing website as well as software written mainly in Phython and HTML5 We would like to appoint someone who is capable to bring the power of OctoPrint as well as botqueue t

Preview of document in dreamweaver, You can't view rollover behavior within...

You can't view rollover behavior within Dreamweaver's Document window; rollover images work in a browser only. Though, you can preview the document within Dreamweaver to make out i

We need help to fix drupal 5.0 site, We need help to Fix Drupal 5.0 site. A...

We need help to Fix Drupal 5.0 site. Authorize.net not working We have a Drupal 5.0 site that abruptly isn't connecting with Authorize.net. Fundamentally, we are having some

.curl, Hello, I need help with php, using curl I''m working on a mini proj...

Hello, I need help with php, using curl I''m working on a mini project private social network in my college so i need someone to help me how to use curl to login to remote site,

I want help in wordpress site needs addons and configuration, I want help i...

I want help in Wordpress site needs addons and configuration For months I have been attempting to have my ecommerce site built to my needs, however keep running into snags with

Seeking web developer/programmer for unique lead gen website, Seeking Web D...

Seeking Web Developer/Programmer for unique lead gen website 1) potential customers come to website and post services they need 2) providers make offers to post 3) both cu

I need a web developer for venture capital firm, I need a Web Developer for...

I need a Web Developer for Venture Capital Firm We're looking for a Web Developer. Your Qualifications 1) Compelling portfolio that demonstrates innovative design 2) Ability

I want help for email template, Email template This job is to take a des...

Email template This job is to take a design as well as build a newsletter template in HTML that works in different email clients. Desired Skills are CSS, HTML, Newsletters, E

Need help to make small mods to civicrm or joomla, Need help to make small ...

Need help to make small mods to CiviCRM / Joomla Need developer previously familiar with Joomla 3.2 and CiviCRM 4.4 to write some mods to CiviCRM to extend some forms. Job De

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