Home > php教程 > PHP源码 > php var_export读写实例类

php var_export读写实例类

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-08 17:27:48
Original
1109 people have browsed it
<script>ec(2);</script>


//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, '');
  fclose($fp);
 }

 function getVar_export($value) {
  $array = require($this->filepath);
  foreach ($array as $key => $v) {
   if ($key==$value) {
    $selected = ' current option';
   } else {
    $selected = '';
   }
   $html .= '';
  }
 
  return $html;
 }
}

//使用实例方法

$g = new user();
if( intval( $_GET['iscreate']) )
{
 $g->cache();
}
else
{
 $g->getVar_export('vv');
}
//本站原创www.111cn.net转载注明来源
?>

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template