The workshop is designed to help you anticipate possible questions, review what you've learned, and begin putting your knowledge into practice.
Can I combine multiple string functions?
Yes. You can nest any function, not just string functions. Just remember to count your opening and closing parentheses to ensure that you've nested your functions appropriately.
What conversion specifier would you use with printf() to format an integer as a double? Indicate 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 we have been formatting in the previous questions?
What 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 break up a delimited string into an array of substrings?
Using PHP, how do you acquire a UNIX time stamp that represents the current date and time?
Which PHP function accepts a time stamp and returns an associative array that represents the given date?
Which PHP function do you use to format date information?
Which PHP function could you use to check the validity of a date?
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 specifierthat is, a space or a zero followed by a number representing the number of characters you want to pad by: 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("%04.2f", 33);
The substr() function extracts and returns a substring.
The ltrim() function removes white space from the start of a string.
The explode() function splits up a string into an array.
The geTDate() function returns an associative array whose elements contain aspects of the given date.
You can check a date with the checkdate() function.
Create a feedback form that accepts a user's full name and an email address. Use case conversion functions to capitalize the first letter of each name the user submits and print the result back to the browser. Check that the user's email address contains the @ symbol and print a warning otherwise.
Create an array of doubles and integers. Loop through the array, converting each element to a floating-point number with a precision of 2. Right-align the output within a field of 20 characters.
Create a birthday countdown script. Given form input of month, day, and year, output a message that tells the user how many days, hours, minutes, and seconds until the big day.