Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Print array to a file

//Either var_export or set print_r to return the output instead of printing it.
$b = array (
    'm' => 'monkey', 
    'foo' => 'bar', 
    'x' => array ('x', 'y', 'z'));

$results = print_r($b, true); // $results now contains output from print_r
//You can then save $results with file_put_contents. Or return it directly when writing to file:

file_put_contents('filename.txt', print_r($b, true));
Comment

PREVIOUS NEXT
Code Example
Php :: array_diff php 
Php :: if else in php 
Php :: @yield extends laravel 
Php :: what is the use of migration file in laravel 
Php :: php response image 
Php :: php artisan key:generate error 
Php :: meta_value wordpress 
Php :: laravel Pushing To Array Session Values 
Php :: PHP substr_replace — Replace text within a portion of a string 
Php :: php loop in js 
Php :: taxonomy-{taxonomy-slug}.php 
Php :: strcmp php 
Php :: laravel throw 503 
Php :: infinite loop php 
Php :: php in html need .htaccess 
Php :: how to hide submenu admin wordpress 
Php :: get city name from latitude and longitude in php using geocode api 
Php :: indexing in database laravel 
Php :: php is datetime 
Php :: laravel eloquent relationships 
Php :: laravel with select 
Php :: where is cache file in laravel 
Php :: laravel rules 
Php :: laravel send data with a redirect 
Php :: laravel route not found 
Php :: php artisan migrate stuck 
Php :: cookie phpsessid will be soon treated as cross-site cookie against 
Php :: how to calculate position of student in class in laravel 
Php :: remove dashboard mya ccount 
Php :: woocommerce status change date 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =