?
Solved

Php code help needed

Posted on 2008-10-07
4
Medium Priority
?
188 Views
Last Modified: 2012-05-05
How do I print in php

in asp it is response.write how is it in php
0
Comment
Question by:eteran
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 24

Accepted Solution

by:
glcummins earned 2000 total points
ID: 22660366
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:

<?php
 
print "Some text";
 
echo "Some more text";
 
?>

Open in new window

0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 22660436
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
0
 
LVL 3

Expert Comment

by:wktang83
ID: 22660580
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:

http://us3.php.net/manual/en/function.printf.php
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 22660691
echo is used to print the output to the user like in asp response.write




0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question