This is an example:
// Query the user and get his unique id and his signature text
// Or fetch it from a text file. Your choise
function translate_signature( $profile, $userid, $signature ){
// So we have
$userid = $array['the_user_tabe_row_id'];
$signature = $array['the_user_table_column_signature'];
$pattern = "signature: $userid"
// better [@signature:1] ( [@signature:$userid])
return str_ireplace($pattern,$signature,$profile);
//or assign variable. Again your choise
}