0
class test{
	
	function load($mailID,$message){
	
	echo $mailID;
        echo $mesage;
	}
	
	function test1($arr,$message){
		
	foreach($arr as $mailID){
	
          $mailID = $mailID.",";
	  $this ->load($mailID,$message);
	  	
       }
	}
}

this is my code ... bt this is nt correct.. actually i need is function test1 get mailadresses and message for the mail.. arr is a array. in function test1 i can put array to mailID variable.. i need is put all the mail adreses to 1 variable and put mesage to 1 variable. then i need to send it to load function. here when i trying to put array to $mailId and send to function load it nicely going to $mailID variable.. bt meassage also looping.. i need meassage go only 1 time to load function.. plz help me..

2
Contributors
2
Replies
4
Views
6 Years
Discussion Span
Last Post by Kadafiz
1

For that you need to make variable concatenation (for mail address) and calling the load function after the loop ends.

function test1($arr,$message){
		
	foreach($arr as $mailID){
		$mailid .= $mailID.", ";
	}
	$this ->load($mailid,$message);
}

Edited by paulrajj: n/a

Votes + Comments
good
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.