FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » question about class getters
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
question about class getters [message #180733] Fri, 15 March 2013 15:42 Go to previous message
daveh is currently offline  daveh
Messages: 18
Registered: March 2013
Karma:
Junior Member
Hello

I have the following code snippet:

Class myClass

{
public function makeArray()
{
$this->my_array = array('Mon', 'Tues', 'Wed', 'Thurs', 'Friday',
'Sat', 'Sun');
}
pubic function getArray()
{
return $this->my_array;
}
}

and then do the following

var $MyVar = new myClass();
var $mydate = $MyVar->getArray[1];
echo $mydate;
=> Mon
will this work? If not how to make it work?

Thanks,

Dave
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Will this set or get a SESSION variable?
Next Topic: Fatal error!
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 00:00:14 GMT 2024

Total time taken to generate the page: 0.04020 seconds