💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
~~~ <?php namespace app\index\controller; use app\index\model\Staff; class Index { public function index(){ //1.创建$data数组 $data['id'] = 10; $data['name'] = 'ThinkPHP'; $data['version'] = '5.0.3'; //2.用$data数组为参数实例化Staff类 $model = new Staff($data); //3.查看$model对象 dump($model); } } ~~~ 输出数据 ~~~ ["data":protected] => array(3) { ["id"] => int(10) ["name"] => string(8) "ThinkPHP" ["version"] => string(5) "5.0.3" } ~~~