$firstName = "Bénny";
$lastName = "O'Drärön";


print ("<input name='myData' type='text' value='".htmlspecialchars($firstName)." ".htmlspecialchars($lastName)."'>");

Produces:

Bénny O

Apparently I am doing something wrong with the concatenation. Do you see anything amiss?

Thanks!