simple array question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
iffo
Forum Commoner
Posts: 37
Joined: Thu Oct 05, 2006 11:56 am

simple array question

Post by iffo »

Hi,

I have this class, am trying to assign arrays to do

public $maninarray= array('344'=> $required_fields_seeking_marriage, '105' => $required_fields_realmaturesingles , '342' => $required_fields_wherechristianmeet2);

i get error

Parse error: syntax error, unexpected T_VARIABLE in on line 30 which is the above code.

Code: Select all

<?
class RomanceTester extends FormData
{
 
  
  
  
  public $required_fields_seeking_marriage = array(
  "zip", "occupation", "fname", "lname", "address", "city", "email", "mainPhone", "age", "my_mar_status", "income", "state", "BestContactTimeID", "sex", "gender1");

 
	public $required_fields_realmaturesingles  = array(
  "zip", "state", "city", "occupation", "fname", "lname", "address", "email", "mainPhone", "age", "my_mar_status", "income", "BestContactTimeID",  "sex");

	
	public $required_fields_thirtyplussingles = array(
  "zip", "fname", "lname", "email", "mainPhone", "age", "income");

	
	public $required_fields_wherechristianmeet2 = array(
  "zip", "fname", "lname", "email", "address", "occupation", "mainPhone", "age", "income", "BestContactTimeID", "my_mar_status",  "sex");


public $maninarray= array('344'=> $required_fields_seeking_marriage, '105' => $required_fields_realmaturesingles , '342' => $required_fields_wherechristianmeet2);


}
Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Class declarations cannot include variable default properties. Assign them at instantiation, or in some other fashion.
iffo
Forum Commoner
Posts: 37
Joined: Thu Oct 05, 2006 11:56 am

Post by iffo »

thanks a lot
Post Reply