mag0103 Posted June 17, 2011 Share Posted June 17, 2011 I'd like to have a mailer class which extends PHPMailer and then email from the mailer class. If I have to pass a large amount of emails to the mailer class, what is the effective way to do that? Thanks in advance. Magg Quote Link to comment https://forums.phpfreaks.com/topic/239624-what-is-an-effective-way-of-passing-a-large-array-to-a-class/ Share on other sites More sharing options...
gristoi Posted June 17, 2011 Share Posted June 17, 2011 PHP thrives on array manipulation. Just pass the array into the class using getters and setters. in your class you can pull the data in through the set: <?php class test { private $_emailArray; public function setEmailArray( $array ) { $this->_emailArray= $array ; } public function getEmailArray() { return $this->_emailArray; } ?> this will allow the array to be passed into and returned from the class. note that you do not need to use the get functionality within the class, Quote Link to comment https://forums.phpfreaks.com/topic/239624-what-is-an-effective-way-of-passing-a-large-array-to-a-class/#findComment-1230953 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.