Sends formatted text to the web browser.
This function is familiar to anyone who has done C programming. printf() takes a string with embedded type specifiers, where formatted data should be inserted. That should be followed by any number of arguments that contain the data that is to be inserted in the string.
<?php
$s = "world";
$temp = 72;
printf("Hello %s! Right now the temperature is %d F. 0x%x seconds have passed since January 1, 1970.",
$s, $temp, time());
?> Hello world! Right now the temperature is 72 F. 0x406b4d70 seconds have passed since January 1, 1970. The code shows printf() in use with the %s, %d, and %x type specifiers.