Home > DeveloperSection > Interviews > How to add to and display values of array?

Posted on    March-18-2011 12:00 AM

 Cold Fusion Cold Fusion 
Ratings:
 1 Answer(s)
  978  View(s)
Rate this:

Amit Singh

Total Post:565

Points:2825
Posted on    March-18-2011 12:00 AM

For Example
<cfset fuitname[1][1] = “apple”>
<cfset fuitname[1][2] = “banana”>
<cfset fuitname[2][1] = “mango”>
<cfset fuitname[2][2] = “grapes”>

Display the value:
<cfoutput>
The first element of fruitname is #fruitname[1][1]# and second is #fruitname[1][2]#
</cfoutput>

output:
The first element of fruitname is apple and second is banana.

Don't want to miss updates? Please click the below button!

Follow MindStick