<?php /*
   +------------------------------------------------------------------+
   | Green-Beast.com                                                  |
   | PHP: Name Truncater                                              |
   | PHP Hypertext Preprocessor                                       |
   | Copyright Jan 2008                                               |
   | Use with attribution by visible link please!                     |
   | Attribute to: <a href="http://green-beast.com/">Mike Cherim</a>  |
   +------------------------------------------------------------------+
*/
?>

<?php
/*
* INSTRUCTIONS:
*
* Use this function on any outputted name data you want. Don't use it
* if for database entires or critial data as it's subject to issues caused
* by people with uncommon name patterns like L. Ron Hubbard. That would
* return L. which might not be appropriate. This is useful for informal
* applications such as returning a success message on a contact form.
*
* Use this like any other function: mod_name($var);
*
*/
?>

<?php // mod_name function - returns first part of multipart string

function mod_name($mod_name) {
    
$mod_name = strip_tags(stripslashes(trim(rtrim($mod_name))));
    
$mod_name = explode(' ', $mod_name);
    
$mod_name = current($mod_name);
  return
$mod_name;
}

?>