I’m trying to display the apostrophe 's after the full name for example Samuel L. Jackson’s but if the last name or middle name is left out the 's is prefixed by a space, for example: Samuel ’s. Can some one help me correct this problem?
Thanks
Here is the PHP code.
if(!empty($first_name) || !empty($middle_name) || !empty($last_name)) {
echo = $first_name . ' ' . $middle_name . ' ' . $last_name . ' \'s';
}
1 Answer