当前位置: 首页>>代码示例>>PHP>>正文


PHP PSU::stripPunct方法代码示例

本文整理汇总了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;
}
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:15,代码来源:phonebook.lib.php


注:本文中的PSU::stripPunct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。