• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

PHP 用switch return 返回值有关问题

php 搞代码 4年前 (2022-01-24) 43次浏览 已收录 0个评论

PHP 用switch return 返回值问题
public function banben(){

$this->load->library(‘LibUser’);

$cc ;
switch ($this->libuser->getUserType()){
case 1:
$cc = $this->libuser->version(“a”);
break;
case 2:
$cc = $this->libuser->version(“b”);
case 6:
$cc = $this->libuser->version(“c”);
break;
default:
$cc = “没有数据”;
break;
}
return $cc;
}
—————————————————-
前提我不想用ifelse ,用switch 能不能 return 回去呢?大虾 出来

/本2文来源[email protected]搞@^&代*@码2网搞gaodaima代码

switch php library

发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址