Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 php 新手,我在 iPhone 上制作了一个应用程序,每个用户都有一个用户名和密码,用户可以注册。我想知道是否有很多用户,如何查看哪个用户已登录?
当用户登录时,将显示他们的信息。
我目前正在使用
if ($id == 1) { //command } if ($id == 2) { //command } else //command
有没有一种可能的方法来检查哪个用户登录而不必执行 if else 语句?
谢谢,
I suggest you to keep last user action time in database. Then select users, which did last action, for example, in last 10 minutes and track them as online users.