Show Output
Format Strings Using printf()
", $str1); // Standard string output printf("[%10s]
", $str1); // Right-justifies the string with spaces printf("[%-10s]
", $str1); // Left-justifies the string value with spaces printf("[%010s]
", $str1); // Left-pads string with zeros. printf("[%-010s]
", $str1); // Right-pads string with zeros printf("[%'#10s]
", $str1); // Left-pads string with '#' character printf("[%.10s]
", $str2); // Cuts off string after 10 characters ?>