Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

fprintf (PHP 5, PHP 7, PHP 8) fprintf — Write a formatted string to a stream

<?php
if (!($fp = fopen('date.txt', 'w'))) {
    return;
}

fprintf($fp, "%04d-%02d-%02d", $year, $month, $day);
// will write the formatted ISO date to date.txt
?>
 
PREVIOUS NEXT
Tagged: #fprintf #PHP #PHP #fprintf #Write #formatted #string #stream
ADD COMMENT
Topic
Name
6+9 =