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..

Recommended Answers

All 2 Replies

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);
}
commented: good +1

heyyy thnkuuu very muchhh..... for quick reply... :)))

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.