fwrite
-
To write data to a file in PHP, we call the
fwritefunction, passing it a stream resource and the data to write.PHP
$f = fopen('/path/to/foobar', 'w'); fwrite($f, 'chars'); fclose($f);
To write data to a file in Ruby, we first get a
Fileinstance and then call theFile#writeinstance method.Ruby
File.open('/path/to/foobar', 'w') do |f| f.write 'chars' end
see also
Looking for Rails or PHP web application development, integration, and training?
Rails for PHP is brought to you by Maintainable Software. Get custom web applications and personalized training from the authors of the book and website.

