@NogDogFeb 06.2021 — #https://www.php.net/sprintf > Returns a string produced according to the formatting string _(Translation: the resulting string is returned, which you can assign to a variable to output later or to use in another function, etc.)_
https://www.php.net/printf > Produces output according to format. _(Translation, it outputs the result immediately, like an echo would)_
Sometimes I see functions with a third Param where the function's data is returned and dumped into the $var that is in the function's 3rd param we mention.
Right ?
You know what, I would understand more with your code samples than the ones in the PHP manual.
@VITSUSAFeb 12.2021 — #@developer_web#1627671 printf("format", args) is used to print the data onto the standard output which is often a computer monitor.
sprintf(char *, "format", args) is like printf. Instead of displaying the formated string on the standard output i.e. a monitor, it stores the formated data in a string pointed to by the char pointer (the very first parameter). The string location is the only difference between printf and sprint syntax.
Ok. I will bear this in mind when revising on print and print and sprintf. I usually use echo and die to print on screen. Hence forget about the others. Forget their params.
@HarshShahFeb 17.2021 — #print() is used to print character stream of data on stdout console and sprintf() is used to store data on character buffer instead of printing on console. This character buffer is specified in sprintf.