//php教程 var_export读写实例类class user{var $filepath;function __(){$this->filepath = "d:/www.111cn.net/group/";}function cache() {$array = $this->db->select('select group_id,group_name from group','hashmap');$fp = fopen ($this->filepath, 'w');fputs($fp, 'php return ' . var_export($array, true) . ';?');fclose($fp);}function getVar_export($value) {$array = require($this->filepath);foreach ($array as $key => $v) {if ($key==$value) {$selected = ' current option';} else {$selected = '';}$html .= '' . $v . '';}return $html;}}//使用实例方法$g = new user();if( intval( $_GET['iscreate']) ){$g->cache();}else{$g->getVar_export('vv');}//本站原创www.111cn.net转载注明来源?>
相关文章
- 基于Golang的静态网页生成器_从Markdown自动构建HTML站点
- 合约交易心态如何控制?克服贪婪与恐惧的职业交易员心法
- Golang函数的类型断言用法介绍
- 教你一招!用Python和Flask创建REST API!
- 如何在Golang中实现反射批量赋值
- PHP怎样使用WebSocket_使用WebSocket实现实时通信【服务】
- 在for循环中如何实现计数器递增_PHP循环递增计数器高效方法
- php分页代码的原理
- PHP Fatal error: Call to undefined function mssql_connect()的解决方法
- C#中RSA非对称加密_C#非对称加密签名教程【进阶】
