Skip to content

Instantly share code, notes, and snippets.

@Morrisai
Created September 4, 2012 16:38
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 Morrisai/3623246 to your computer and use it in GitHub Desktop.
Save Morrisai/3623246 to your computer and use it in GitHub Desktop.
displaying and formatting faculty names
<div class="profile_detail"> <span class="title04">
<?php
$firstpart = strtok($faculty_data['Faculty']['firstName']." ".$faculty['Faculty']['middleName']." ".$faculty_data['Faculty']['lastName']," ");
echo $firstpart;
$tot_len = strlen($faculty_data['Faculty']['firstName']." ".$faculty['Faculty']['middleName']." ".$faculty_data['Faculty']['lastName']);
$len = strlen($firstpart);
$example = substr($faculty_data['Faculty']['firstName']." ".$faculty['Faculty']['middleName']." ".$faculty_data['Faculty']['lastName'],$len,$tot_len-$len);
?>
<br />
<?php
echo $example;
?></span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment