Friday 27 July 2012

sprintf() function

function sprintf() returns a formatted string, according to the formatting string format.
$numOfStudent = 50;
$class = 'Class';
$format = 'There are %d Students in the %s';
echo sprintf($format, $numOfStudent, $class);
// output will be: There are 50 Students in the Class
?>

No comments:

Post a Comment