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.
我想声明我将在脚本中使用的所有变量,例如
$user_class= ''; $user_id = 0; $user_profile = '';
$user_class 应该使用什么作为对象?
如果您不想创建用户类,可以将其声明为标准对象:
$user = new stdClass(); $user->class = "employee"; $user->id = 0;
声明一个类User:
class User { // property declaration public $id; public $class; } // usage $u1 = new User();