1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace loyalsoft;
- /**
- * 玩家信息 for Each User in Memcache
- * Ps.
- * @author gwang
- */
- class UserInfoMo {
- /**
- * 玩家游戏数据
- * @var Data_UserGame
- */
- public $game;
- /**
- * 获得用户的平台字符串
- * @return string
- */
- function getPlatStr() {
- switch (PLAT) {
- case 'web': # web版
- return 'qzone'; # only QQ空间
- case 'ios': # ios版
- return 'ios'; # only ios
- case 'and': # 安卓版/默认
- default :
- return substr(req()->uid, 0, strrpos(req()->uid, '-')); # 提取平台字符串
- //substr() 函数返回字符串的一部分 strrpos() 函数查找字符串在另一字符串中最后一次出现的位置。
- }
- }
- }
|