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

We are in need programming expert, We are in need Programming expert I w...

We are in need Programming expert I want someone to write codes for an idea I have. To be honest I do not really trust the security of this site to disclose my idea without havi

File menu in dreamweaver, File Menu: Under it we have New, Save as, Save, S...

File Menu: Under it we have New, Save as, Save, Save as template, Export, Import, Preview in browser so on options. Edit Menu: In this menu we have Copy,  Cut, Paste, Redo, Undo

Modify auth on code igniter for cakephp, Modify auth on code igniter for ca...

Modify auth on code igniter for cakephp auth, SSO lite Project Description: I start to develop apps with cakephp, but now i wish to add forum made with code igniter. i nee

Want html/css templates created from layout images not psd, Want HTML/CSS t...

Want HTML/CSS templates created from layout images (not PSD). Responsive. Greetings I have a want for a GREAT HTML/CSS developer that understands responsive CSS also. I have fou

I need a responsive web programmer, Responsive Web programmer In want of...

Responsive Web programmer In want of responsive web programmer to finish my portfolio project. Very simple job scope, html and fluid grid and some javascript. PSD files will be

Need help to develop online calculator, Develop Online Calculator I want...

Develop Online Calculator I want someone who sees the big picture with this project. I want an online calculator created that will utilize the inputs from users to determine wha

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

I need help to develop a web app, I need help to develop a Web App The j...

I need help to develop a Web App The job will include developing a website and advertising platform Job Description- We're looking for a Web Developer. Your responsibiliti

I need expert wordpress template developer, I need expert Wordpress Templat...

I need expert Wordpress Template Developer I have a website design I would like to turn into a wordpress template. Specifications- Responsive - One page - two scroll - Cou

Introduction to javascript, You can declare a variable by the var statement...

You can declare a variable by the var statement such as: var strname = some value You can also declare a variable with simply assigning a value to the variable. Although, if

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