• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

Php code help needed

How do I print in php

in asp it is response.write how is it in php
1 Solution
If you mean "print to a printer", you don't. PHP is primarily designed to generate HTML, and you will be able to print the HTML output via your browser as normal.

If you mean, how do you display text, you can use the "print" or "echo" commands:

print "Some text";
echo "Some more text";

Open in new window

Ray PaseurCommented:
There is a very good resource on the php.net web site - it is all the manual pages with user comments.  Have a look at this example: http://us3.php.net/manual/en/function.echo.php

HTH, ~Ray
Also, if you want to output formatted string (such as floating values with a number of decimal digits), you can use this useful function -- printf:

Loganathan NatarajanLAMP DeveloperCommented:
echo is used to print the output to the user like in asp response.write

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now