Skip to content

Instantly share code, notes, and snippets.

@ethicka
Created April 29, 2020 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethicka/ffc3dbabc5a0f2cf68a14257ea73ed43 to your computer and use it in GitHub Desktop.
Save ethicka/ffc3dbabc5a0f2cf68a14257ea73ed43 to your computer and use it in GitHub Desktop.
Build a name from a prefix and suffix
<?php
/**
* Build a name
*/
function build_name($prefix, $fname, $lname, $suffix) {
$name = $fname . ' ' . $lname;
if($prefix) $name = $prefix . ' ' . $name;
if($suffix) $name = $name .= $suffix;
return $name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment