您好我有一个Facebook登录代码,我试图将名称的格式更改为名字 - 姓氏有没有办法做到这一点?我的代码在
之下我无法包含所有代码,因为它很长
//Example: Say my name on fb was... Josh Smith
//$_SESSION['user']['username'] = "Josh-Smith";
//Code
$user_info = $facebook->api('/me/');
$_SESSION['user']['username'] = $user_info['name'];
答案 0 :(得分:0)
//Code
$user_info = $facebook->api('/me/');
$_SESSION['user']['username'] = $user_info['first_name'] . '-' . $user_info['last_name'];