Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and work.


Instant Grammar Checker - Correct all grammar errors and enhance your writing

Linux Training
Teach Your Child To Read

BlueHost Web Hosting Black Friday

Bonsai Boy of New York Bonsai Trees and Accessories

DreamCloud The Comfortable Luxury Mattress Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

DreamHost Web Hosting

Disclosure We are a professional Programming & Software Q&A website, that receives compensation from some of the links whose we show you with Information. It means that my content may contain affiliate links.

16,919 questions

22,608 answers

573 users

How to write formatted string to a text file using vfprintf() in PHP

Linux Foundation - Training

asked Jul 23, 2016 by avibootz
edited Oct 4, 2016 by avibootz

1 Answer

0 votes
if (!($fp = fopen('d:\\date.txt', 'w')))

$f = 3.14;
$n = 100;
$s = "hi";
vfprintf($fp, "%.2f %d %s", array($f, $n, $s));


 // data.txt
 // 3.14 100 hi



answered Jul 23, 2016 by avibootz