Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

$name = "full_name" same ?

With $name = $full_name , i just overrider $name variable. So isn't it simpler to change the value in $name ?

Dont get this part so well

Hugo Paz
Hugo Paz
15,622 Points

Hi peyman,

Could you please link the video in question?

3 Answers

Kevin Korte
Kevin Korte
28,149 Points

In this example, Hampton is just showing that you can reassign variables, the order it happens in, and that you can assign or reassign variables with other variables. It's not a super practical example, but it does clearly show this.

Reassigning variables are super handy when you want to take a value, do something to it, and reassign it to itself. Like $x = $x + 1

Hope that clears it up.

Now I get it. Thank u Kevin.

Was a little confused

Kevin Korte
Kevin Korte
28,149 Points

No problem. You're welcome. A lot of the foundation classes here have examples that are practical in real world applications, but are essential to a solid foundation.