Jump to content

[SOLVED] default value for function variable


maddogandnoriko

Recommended Posts

Can someone tell me why this is generating and unexpected tvariable error? this->languages[0] is 'en' and id is set. This function is in a class. I wanted the language to be set to languages[0] if no value was passed. And the function works if I remove:$language=$this->languages[0].

 

Thank you

                maddogandnoriko

 

  function getXML($ID,$language=$this->languages[0]){
	$url= $this->URL .API.'/all/'.$language.'.xml';
	$this->xml = simplexml_load_file($url);
  }

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.