Jump to content

[SOLVED] string replace help


emehrkay

Recommended Posts

Thanks suzzanne, I actually figured it out.

 

while creating my $val array, i create a replace_val array and just do str_replace

 

<?php
foreach($arr as $key => $val){
		if($key == 'email_id'){
			$this->_email_id = $val;
		}else{
			$this->_vars[$key] = $val;
			$this->_replace_vars[] = '<['. $key .']>';
		}
	}

private function buildEmail(){
	$email = emailSQL::getEmailText($this->_email_id);
	return str_replace($this->_replace_vars, $this->_vars, $email);
}
?>

 

i just hope that it works

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.