See explanation in comments:
$common_words = array("van", "der", "de");
// initialize an array for removed words
$removedWords = array();
// save string to array
$achternaamArray = explode(' ', $achternaam);
// cycle through the array
foreach($achternaamArray as $key => $namePart) {
// check if current word is in common words array
// or is empty string (after trimming)
if(in_array($namePart, $common_words) || trim($namePart) == '') {
// if yes, add it to the removed words array
// and remove it from the main array
$removedWords[] = $namePart;
unset($achternaamArray[$key]);
}
}
// now you have only unremoved words in the $achternaamArray
// implode it to string (and capitalize first letter)
echo ucfirst(implode(' ', $achternaamArray)) . '<br>';
// display the removed words
echo 'Removed words: ' . implode(', ', $removedWords);