you can use sprintf() function
sprintf($txt['fb_password_welcome'], $password)
anf then
$txt['fb_password_welcome'] = 'Here is your password for the forum %1$s . You can use it to update your profile account setttings.';
then setup the pm like so
//Set up the pm
$title = 'Forum password'; //the title of the pm
$message = sprintf($txt['fb_password_welcome'], $password); //the body of the pm
$pmfrom = array(
'id' => 0, //user id where the pm is from
'name' => 'Admin', //name of the user who the pm is from
'username' => 'Admin', //username of the user who the pm is from
);
$pmto = array(
'to' => array($memberID),// array of ids to send the pm to
'bcc' => array()//bbc array
);
//Now send it
sendpm($pmto, $title, $message , 0, $pmfrom);