本文整理汇总了PHP中PSU::stripPunct方法的典型用法代码示例。如果您正苦于以下问题:PHP PSU::stripPunct方法的具体用法?PHP PSU::stripPunct怎么用?PHP PSU::stripPunct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PSU
的用法示例。
在下文中一共展示了PSU::stripPunct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formatRecord
function formatRecord($person, $merge_with = array())
{
$base_person = array('pidm' => '', 'wpid' => '', 'psu_id' => '', 'username' => '', 'email' => '', 'msc' => '', 'name_first' => '', 'name_first_formatted' => '', 'name_first_metaphone' => '', 'name_last' => '', 'name_last_formatted' => '', 'name_last_metaphone' => '', 'name_middle_formatted' => '', 'name_full' => '', 'phone_of' => '', 'phone_vm' => '', 'emp' => '0', 'stu' => '0', 'stu_account' => '0', 'dept' => '', 'title' => '', 'major' => '', 'has_idcard' => '0');
$person['office_phone'] = PSU::stripPunct($person['office_phone']);
$person['phone_number'] = PSU::stripPunct($person['phone_number']);
if ($merge_with) {
$merge_with = PSU::params($merge_with, $base_person);
$person = PSU::params($person, $merge_with);
} else {
$person = PSU::params($person, $base_person);
}
//end else
$final = array('pidm' => $person['pidm'], 'wpid' => $person['wp_id'], 'psu_id' => $person['psu_id'], 'username' => !strpos($person['username'], '@') ? trim($person['username']) : substr($person['username'], 0, strpos($person['username'], '@')), 'email' => !strpos($person['email'], '@') ? trim($person['email']) : substr($person['email'], 0, strpos($person['email'], '@')), 'msc' => $person['msc'] ? $person['msc'] : '', 'name_first' => PSU::stripPunct($person['first_name']), 'name_first_formatted' => $person['first_name'], 'name_first_metaphone' => metaphone(PSU::stripPunct($person['first_name'])), 'name_last' => PSU::stripPunct($person['last_name']), 'name_last_formatted' => $person['last_name'], 'name_last_metaphone' => metaphone(PSU::stripPunct($person['last_name'])), 'name_middle_formatted' => $person['middle_name'], 'name_full' => trim(preg_replace('/\\s\\s+/', ' ', $person['first_name'] . ' ' . substr($person['middle_name'], 0, 1) . ' ' . $person['last_name'] . ' ' . $person['spbpers_name_suffix'])), 'phone_of' => $person['office_phone'] ? '(603) ' . substr($person['office_phone'], 0, 3) . '-' . substr($person['office_phone'], 3) : FALSE, 'phone_vm' => $person['phone_number'] ? '(603) ' . substr($person['phone_number'], 0, 3) . '-' . substr($person['phone_number'], 3) : FALSE, 'emp' => $person['emp'] ? 1 : 0, 'stu' => $person['stu'] ? 1 : 0, 'stu_account' => $person['stu_account'] ? 1 : 0, 'dept' => $person['department'] ?: '', 'title' => $person['title'] ?: '', 'major' => $person['major'] ?: '', 'has_idcard' => $person['has_idcard']);
return $final;
}