Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php save array to file

$arr1 = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5);
file_put_contents("array.json",json_encode($arr1));
# array.json => {"a":1,"b":2,"c":3,"d":4,"e":5}
$arr2 = json_decode(file_get_contents('array.json'), true);
$arr1 === $arr2 # => true
Comment

PREVIOUS NEXT
Code Example
Php :: how to get category from post id 
Php :: laravel table data types 
Php :: number format comma php 
Php :: laravel enum migration example 
Php :: wp_query count result 
Php :: delete folder laravel 
Php :: force https with php 
Php :: file delete in laravel 
Php :: laravel custom model primary Key 
Php :: php foreach first element 
Php :: php timezone asia dhaka 
Php :: get template name wordpress 
Php :: php curl post json 
Php :: php reset array keys 
Php :: laravel eloquent only today 
Php :: wordpress if is in category 
Php :: laravel migration price 
Php :: php ellipsis 
Php :: complete url php 
Php :: start server in laravel 
Php :: laravel check auth 
Php :: php find keyword in string 
Php :: php force array keys to lowercase 
Php :: laravel model to array 
Php :: previous url laravel 
Php :: wordpress get particular page content programmatically 
Php :: How to prevent Browser cache for php site 
Php :: get_posts category 
Php :: geoip php sample 
Php :: php round all values in array 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =