Any text outside PHP tags is automatically sent to the browser. This is as you would Expect PHP offers three functions that simply send text to the browser: echo , print , and printf .
The echo string first, string second, . . ., string last
The echo function sends any number of parameters, separated by commas, to the browser. Each will be converted to a string and printed with no space between them. Unlike most other PHP functions, the echo function does not require parentheses. In fact, echo is more of a statement than a function.<?
As text is sent to the browser via functions like print and echo, it may be stored in a memory buffer and written out only when the buffer fills. The flush function attempts to force the buffer to be dumped to the browser immediately. Since the Web server ultimately controls communication with the browser, the flush may not be effective. If your script takes a long time to execute, it's a good idea to output a status message and flush the buffer. This keeps the user from clicking away.<?
The output argument of print is sent to the browser.<?
printf(string format, . . .)
The printf function converts and outputs arguments to the browser based on a format string. The ormat string contains codes, listed in Table 8. 1, for different data types. These codes begin ith a percentage sign, %, and end with a letter that determines the type of data. The codes match up with a list of values that follow the format string in the rgument list. Any text outside these codes will be sent unchanged to the browser.
You also have the option of placing characters between the % and the type specifier that control how the data is formatted. Immediately following the % you may place any number of flags. These flags control padding and alignment.
After any flags, you may specify a minimum field length. The converted output will be printed in a field at least this wide, longer if necessary. If the output is shorter than the minimum width, it will be padded with a padding character, a space by default. The padding will normally be placed to the left but, if the - flag is used, it will be placed to the right.
Next, you may specify a precision. It must start with a period to separate it from the minimum field length. For strings, the precision is taken to mean a maximum field length. For doubles, the precision is the number of digits that appear after the decimal point. Precision has no meaning for integers.
PHP Related Interview Questions
|PHP Interview Questions||MySQL Interview Questions|
|PHP+MySQL Interview Questions||Drupal Interview Questions|
|MYSQL DBA Interview Questions||PHP5 Interview Questions|
|WordPress Interview Questions||Joomla Interview Questions|
|CakePHP Interview Questions||CodeIgniter Interview Questions|
|PHP7 Interview Questions|
An Introduction To Php
Variables, Operators, And Expressions
Classes And Objects
I/o And Disk Access
Time, Date, And Configuration Functions
Parsing And String Evaluation
Sorting Searching And Random Numbers
Integration With Html
Efficiency And Debugging
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.