Question
How to open standard output as a file handle?

Answers

If you want to open the standard output as a file handle yourself, you can use the fopen("php://stdout") function. It creates a special file handle linking to the standard output, and returns the file handle. Once the standard output is opened to a file handle, you can use fwrite() to write data to the starndard output like a regular file. Here is a PHP script example on how to write to standard output:
$stdout = fopen("php://stdout", "w");
fwrite($stdout,"To do:
");
fwrite($stdout,"Looking for PHP hosting provider!
");
fclose($stdout);
?>
This script will print:
What's your name?
To do:
Looking for PHP hosting provider!
If you don't want to open the standard output as a file handle yourself, you can use the constant STDOUT predefined by PHP as the file handle for standard output.
If you are using your script in a Web page, standard output is merged into the Web page HTML document.
print() and echo() also writes to standard output.   Your Comment




More Software Questions..
What is the inputsplit in map reduce software?

What is software configuration management?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?

What are the minimum system requirements to run Photoshop? Is it possible to run Photoshop over linux?

Which oracle package is used to manage the oracle lock management services?

What is Latch Up? Explain Latch Up with cross section of a CMOS Inverter. How do you avoid Latch Up?

What is marker interface?

What types of partitioning are there for BW?



Search
Can you Answer!!
  • Q What is the name of Prince of UAE?
  • Q What is concatenation?
  • Q What's the difference between forward and sendredirect?
  • Q Was Hazrat Isa (a.s.) born on 25th December, according to our history?
  • Q 70% people would stamp barefoot broken glass that watch what
  • Q Name the Vice President of United States to whom President Barack Obama bestowed the United State's highest civil honor, Presidential Medal of Freedom during a White House ceremony?
  • Q What attitude should be used in reading and speaking?
  • Q Born January 21st to February 19th what star sign are you
  • Q Who was the first Englishman to preside over a Congress session ?
  • Q Why is it that JComponent have add() and remove() methods but Component doesn't?
  • Q What are Struts2 core components