Page 1 of 1

can an array have same values? say like array('a','a')?

Posted: Thu Mar 04, 2010 11:34 pm
by indian98476
'empstatus'=>array('select','empstatus',array(array('','Choose One'), array('Associate','Associate'),
array('Government Employee','Government Employee'),
array('Partner','Partner'),
array('Solo Practice','Solo Practice'),
array('Independent Contractor','Independent Contractor'),
array('Law Student','Law Student'),
array('Other','Other')), array('class'=>"fillin2", 'style'=>"width:200px;"),'empstatus'),



could anyone explain me the above code? it was posted for a registration form and this is the employee status...

Re: can an array have same values? say like array('a','a')?

Posted: Fri Mar 05, 2010 2:28 am
by requinix
To the first question you asked: yes, they can have any values - it's the array keys that have to be unique.

To the question you snuck in there: It's an array. It doesn't do anything by itself, but it looks like it represents a <select> form field.

Re: can an array have same values? say like array('a','a')?

Posted: Mon Mar 15, 2010 3:50 am
by indian98476
thnx..it sure is a select field in form....but why do they have the field name empstatus in the end after all the other arrays?

Re: can an array have same values? say like array('a','a')?

Posted: Mon Mar 15, 2010 4:07 am
by requinix
Because that's the way whoever wrote the code designed it.