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 trialBarak TheProgrammer
1,773 Pointshey, im on php basics course with Alea Holligan.
my question is about the second's video teacher's notes, i didn't understand what does she mean over there. may someone will clear it for me please? thanks :)
1 Answer
Alexander Davison
65,469 PointsJust note that it isn't that important.
It's just explaining that echo
and print
are a little bit different, because print
returns the value 1 and echo doesn't return anything.
Just keep in mind to try to use echo
and only use print
when you really have to. The echo
function/method is a little but faster and is used more often.
~Alex
Barak TheProgrammer
1,773 PointsBarak TheProgrammer
1,773 Pointswhat does it mean "print return 1" cause as i get it print just need to output the text dont it?
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsThe print function does print out the value of whatever you say, but it returns 1.
Returning a value isn't the same as printing a value :)
For example take a look at this:
The code above will print out:
Anyway, you will learn more about functions and returning values in a future video