Have an account? Sign in
Login  Register  Facebook
This Page is Under Construction! - If You Want To Help Please Send your CV - Advanced Web Core (BETA)
Quick Table of Contents
  • print() — statement outputs data passed to it
  • echo() — statement for the same purposes as print()
  • printf() — output a blend of static text and dynamic information
  • sprintf() — identical to printf() except that the output is assigned to a string
[Edit] The sprintf() Statement
The sprintf() statement is functionally identical to printf() except that the output is assigned to a string rather than rendered to the browser. The prototype follows:
string sprintf(string format [, mixed arguments])
An example follows:
$cost = sprintf("$%.2f", 43.2); // $cost = $43.20
September 12, 2011