Formatting
String formatting allows creating formatted output.
Common functions include:
printf()sprintf()
Example
Section titled “Example”$name = "John";$age = 30;
printf("%s is %d years old", $name, $age);Using sprintf
Section titled “Using sprintf”$message = sprintf("Price: %.2f", 10.5);
echo $message;