Atitit 基于文件的数据库保存系统json文档数据库 目录 1.1. 一行数据一个文件,一个文件夹微数据表表 1 1.2. 保存C:wampwww isye isye.php 1 1.3

Atitit 基于文件的数据库保存系统json文档数据库

 

目录

1.1. 一行数据一个文件,一个文件夹微数据表表 1

1.2. 保存C:wampwww isye isye.php 1

1.3. 列表 tisye_mng_list.php 1

 

    1. 一行数据一个文件,一个文件夹微数据表表

 

    1. 保存C:wampwww isye isye.php

<?php

 

parse_str$_SERVER'QUERY_STRING' ],$parr);print_r($parr);

 

  $json_str=json_encode($parr);

file_put_contents("C:\data\tisyi\".time(), $json_str);

 print ('ok');

// echo "Hello world!<br>";

$aa=333;

?>

 

 

 

    1. 列表 tisye_mng_list.php

 

//readfile

  $fsscandir("C:\data\tisyi");

  //print_r($fs);

  //print_r ("------------------------") ;

    $jsonn_arr="[";

  foreach($fs as $f){

    if($f=='.' || $f=='..')

      continue;

    $cur_f="C:\data\tisyi\".$f;

 

   // print_r("++++");

    $txt=file_get_contents($cur_f);

    //print_r( $txt);

   // print_r("@@@".$txt."####");

   // print_r( " ");

   // die();

    if$jsonn_arr=="[")

        $jsonn_arr$jsonn_arr.$txt." ";

    else

        $jsonn_arr=$jsonn_arr.","$txt." ";

 

  //   print_r($jsonn_arr);

   //  print_r( " ");  

    }

    $jsonn_arr$jsonn_arr."]";

  //  print_r( $jsonn_arr);

   echo $jsonn_arr;

$aa=333;

?>

 

原文地址:https://www.cnblogs.com/attilax/p/15196998.html