PHP » PYTHON |
login |
register |
about
|
fp = open('date.txt', 'w') fp.write("%04d-%02d-%02d" % (year, month, day)) outputs a newline (2.x): fp = open('date.txt', 'w') print >> fp, "%04d-%02d-%02d" % (year, month, day) outputs a newline (3.x): fp = open('date.txt', 'w') print("%04d-%02d-%02d" % (year, month, day), file=fp) fprintf(PHP 5) fprintf — Write a formatted string to a stream DescriptionWrite a string produced according to format to the stream resource specified by handle . Parameters
Return ValuesReturns the length of the string written. Examples
Example #1 fprintf(): zero-padded integers
<?php
Example #2 fprintf(): formatting currency
<?php
See Also
|
more
Recently updated
more
Most requested
|