PHP Classes

File: test/file/file.php

Recommend this page to a friend!
  Classes of Peter  >  Storage Class  >  test/file/file.php  >  Download  
File: test/file/file.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Storage Class
Manipulate data in arrays and store it in files
Author: By
Last change: Merge branch 'master' of github.com:teed7334-restore/storage

Conflicts:
README.md
Date: 6 years ago
Size: 1,286 bytes
 

Contents

Class file image Download
<?php
include_once('../../config/config_setting.php');
$config = config_setting::get_config();
$base_path = $config['base_path'];
include_once(
"{$base_path}/file.php");
$file = new file();
$customer = array(
    array(
'id' => 1, 'name' => 'Peter', 'address' => 'AAAA', 'mobile' => '0900123456'),
    array(
'id' => 2, 'name' => 'Bill', 'address' => 'BBBB', 'mobile' => '0910123456'),
    array(
'id' => 3, 'name' => 'Ryan', 'address' => 'CCCC', 'mobile' => '0920123456'),
    array(
'id' => 4, 'name' => 'Chris', 'address' => 'DDDD', 'mobile' => '0930123456'),
    array(
'id' => 5, 'name' => 'John', 'address' => 'EEEE', 'mobile' => '0940123456'),
    array(
'id' => 6, 'name' => 'Peter', 'address' => 'FFFF', 'mobile' => '0950123456'),
    array(
'id' => 7, 'name' => 'Bill', 'address' => 'GGGG', 'mobile' => '0960123456'),
    array(
'id' => 8, 'name' => 'Ryan', 'address' => 'HHHH', 'mobile' => '0970123456'),
    array(
'id' => 9, 'name' => 'Chris', 'address' => 'IIII', 'mobile' => '0980123456'),
    array(
'id' => 10, 'name' => 'John', 'address' => 'JJJJ', 'mobile' => '0990123456'),
);
$filename = md5('customer');
$file->set_encode('php');
$file->open($filename);
$file->save($customer);
print_r($file->load());
$filename = $file->get_filename();
$file->close();
unlink($filename);

For more information send a message to info at phpclasses dot org.