Workshop

Quiz

1: 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.
2: 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?
3: How would you specify a precision of two decimal places for the floating-point number you have been formatting in the previous questions?
4: Which function would you use to determine the length of a string?
5: Which function would you use to acquire the starting index of a substring within a string?
6: Which function would you use to extract a substring from a string?
7: How might you remove white space from the beginning of a string? ...

Get Sams Teach Yourself PHP in 24 Hours, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.