Follow:  Follow PHPExercises on Twitter  Follow us on Facebook

PHP Beginnings Ex. #2: Create and Use Variables

For your second PHP exercise, echo the following statement to the browser:

“Twinkle, Twinkle little star.”

Next, create two variables, one for the word “Twinkle” and one for the word “star”. Echo the statement to the browser, this time substituting the variables for the relevant words. Change the value of each variable to whatever you like, and echo the statement a third time. Remember to include code to show your statements on different lines.

Comments are closed on the first two exercises.