FAQ: PHP Strings and Variables - Variable Parsing

This community-built FAQ covers the “Variable Parsing” exercise from the lesson “PHP Strings and Variables”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn PHP

FAQs on the exercise Variable Parsing

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

How can I work with HTML and PHP code in the same PHP file. Because no mater how ever hard I try to work with my PHP and the HTML it dose not work even if try linking the PHP file with the HTML file, still it dose not work.
Any more solutions?
please explain.

Hi this is me I did what it said but it isn’t working can you help me?

<?php // Fill in the blanks in the code below: $noun = "Donald Trump"; $adjective = "angry"; $verb = "burp"; echo "The world's most beloved $noun was very $adjective and loved to $verb every single day."; //Fix the code below and uncomment it: I

@jrplayz

It works fine. What error did you get?

$noun = "Donald Trump"; 
$adjective = "angry"; 
$verb = "burp"; 
echo "The world's most beloved $noun was very $adjective and loved to $verb every single day.";

Output:

The world’s most beloved Donald Trump was very angry and loved to burp every single day.

Edit:
Okay I think you got an error because of the space in your $noun variable. The exercise was probably not coded for proper nouns. Use common nouns instead; such as ‘president’, ‘leader’, or ‘man’.

That was so long ago i forgot what i was doing sorry.

and yeah it does work woops

Regarding lesson: Learn PHP Variables, Strings, and Numbers | Codecademy

Using ${} in strings is deprecated.

${var} string interpolation deprecated - PHP 8.2 • PHP.Watch

2 Likes