I want to write a formatted string that will process to a specific output stream like a file. What function is good for this?
I want to write a formatted string that will process to a specific output stream like a file. What function is good for this? was last modified: March 23rd, 2023 by
1 Answers
Best Answer
You can use the printf() function. Here is an example.
[php]<?php<br />$var = 3;<br />$string = "Puppies";<br />$thefile = fopen("foo.txt","w");<br />echo fprintf($thefile,"I have %u very cute %s.",$number,$str);<br />?>[/php]
Answer for I want to write a formatted string that will process to a specific output stream like a file. What function is good for this? was last modified: December 13th, 2018 by