it's tough for me to tell exactly what you are doing here because you are not giving me the whole code block, the truncated code does not help.
I'm assuming you are doing the str_replace on the $pkey variable?
you can do more than one str_replace operation on the same variable, here is example code that would change a form element name "naam2" to "name" and another named "naamlast" to "last name"
echo(str_replace("naam2","name",str_replace("naamlast","last name",$pkey)));
for more details see the str_replace manual page on the php sire:
function.str-replace.php