Home > Backend Development > PHP Tutorial > PHP writes array to file_PHP tutorial

PHP writes array to file_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:34:46
Original
962 people have browsed it

php writes array to file

php writes the array to the file through sequence and desequence. Please see the code $file="./data/file.cache";file_put_contents($file,serialize($array));//Write cache

$file="./data/file.cache";

$array = array("count" => "3000",

"num" =>"300");

//Cache

file_put_contents($file,serialize($array));//Write cache
?>
$file="./data/file.cache";
$handle = fopen($file, "r");
$cacheArray = unserialize(fread($handle, filesize ($file)));
print_r($cacheArray);
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/508435.htmlTechArticlephp writes the array to the file php writes the array to the file, implemented through sequence and desequence. Please see the code $file=./data/file.cache;file_put_contents($file,serialize($array));//Write cache?...
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template