aeroswat Posted February 15, 2010 Share Posted February 15, 2010 I'm trying to figure out why this $res['StudentFName'] = "Carolyn (Beth)" (strrpos($res['StudentFName'],' ') > 0 ? substr(preg_replace("/[^a-zA-Z\s]/",'',$res['StudentFName']),0,strrpos($res['StudentFName'],' ')+2) . "." : $res['StudentFName']) is returning Carolyn Beth . but this $res['StudentFName'] = "Richard (Isaiah)" (strrpos($res['StudentFName'],' ') > 0 ? substr(preg_replace("/[^a-zA-Z\s]/",'',$res['StudentFName']),0,strrpos($res['StudentFName'],' ')+2) . "." : $res['StudentFName']) is returning Richard I. Link to comment https://forums.phpfreaks.com/topic/192160-can-someone-please-explain-why-this-is-doing-this/ Share on other sites More sharing options...
aeroswat Posted February 15, 2010 Author Share Posted February 15, 2010 I figured it out. It was a problem with my database. Somehow that specific person had a blank space after their name Link to comment https://forums.phpfreaks.com/topic/192160-can-someone-please-explain-why-this-is-doing-this/#findComment-1012693 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.