Mobile app version of vmapp.org
Login or Join
Moriarity557

: What's the point of an Echo command in PHP? I'm working in Dreamweaver, following a course from Lynda.com The teacher has me add an echo command and then observe the code in my browser. I

@Moriarity557

Posted in: #Dreamweaver

I'm working in Dreamweaver, following a course from Lynda.com

The teacher has me add an echo command and then observe the code in my browser.

I simply could not understand what the purpose of this command is?

Sorry, I'm new to code. Please explain slowly. I used to work in design view.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Moriarity557

2 Comments

Sorted by latest first Latest Oldest Best

 

@Sherry384

To answer your comment on the other answer:

Writing Hello Warren is static. It would be the same for everyone who visited the site. echo "Hello ".$user."!" will replace $user with whatever name you specified as your name when you created an account.

As an example, when you create an account on facebook and fill out your profile, your name, birthdate, etc. are all saved in a database. When you put something like $user in your code, your code references the database to find out what your name is so it can display your name instad of a static element like Warren for everyone.

10% popularity Vote Up Vote Down


 

@Miguel251

In php language, the point is the concatenate string symbol, and the echo function, outputs the content.

p.eg:
I asumme the value of the variable $user is Warren
echo "Hello ".$user."!" outputs Hello Warren!

That's it! :)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme