You are here : phpstringfprintf

fprintf() - string

Write a string produced according to format to the
   stream resource specified by handle.
Parameters :
  • handle - A file system pointer resource that is typically created using fopen().
  • format - See sprintf() for a description of format.
  • args -
  • ... -

  • Syntax

    int fprintf
        ( resource $handle
       , string $format
       [, mixed $args
       [, mixed $...
      ]] )


    Example

    <?phpif (!($fp = fopen('date.txt', 'w'))) {    return;}fprintf($fp, "%04d-%02d-%02d", $year, $month, $day);// will write the formatted ISO date to date.txt?>


    Output / Return Value


    Limitations


    Alternatives / See Also


    Reference