Which conversion specifier would you use with printf() to format an integer as a double? Write down the full syntax required to convert the integer 33.
How would you pad the conversion you effected in question 1 with zeroes so that the part before the decimal point is four characters long?
How would you specify a precision of two decimal places for the floating-point number you have been formatting in the previous questions?
Which function would you use to determine the length of a string?
Which function would you use to acquire the starting index of a substring within a string?
Which function would you use to extract a substring from a string?
How might you remove white space from the beginning of a string?
How would you convert a string to uppercase characters?
How would you break up a delimited string into an array of substrings?
The conversion specifier f is used to format an integer as a double:
printf("%f", 33 );
You can pad the output from printf() with the padding specifier—that is, a space or a zero followed by a number representing the number of characters by which you want to pad:
printf("%04f", 33 );
The precision specifier consists of a dot (.) followed by a number representing the precision you want to apply. It should be placed before the conversion specifier:
printf("%4.2f", 33 );
The strlen() function returns the length of a string.
The strstr() function returns the starting index of a substring.
The substr() function extracts and returns a substring.
The ltrim() function removes white space from the start of a string.
The strtoupper() function converts a string to uppercase characters.
The explode() function splits up a string into an array.