1.What are the difference between echo , print , print_r ?
else this 3 can we show output to a client in some other
way?

Answers were Sorted based on User's Feedback



1.What are the difference between echo , print , print_r ? else this 3 can we show output to a clie..

Answer / ajay

echo is a statement where print_r,print are the functions
which is prints all the variable result..
If the variable is an Array, then Print_r will prints the
array in details (Array[0]-> " the array values")...
where as the other two(echo and print) only prints as ARRAY().

Is This Answer Correct ?    2 Yes 2 No

1.What are the difference between echo , print , print_r ? else this 3 can we show output to a clie..

Answer / ramesh

echo is not a function only it is display String Or integer Values

echo $record;
Array



print is a function it display the string and integer values it not applicable for loops and arrays

print($record);

Array

print_r is a return function it used for Strings and integers and as well as array of values and return object values

do u want effective retriview data from arrays use below statement

print_r($record);

Array ( [id] => 0 [date_details] => [password] => dasf [email] => sdfhhh )

echo "<pre>"; print_r($record);echo "</pre>";

Array
(
[id] => 0
[date_details] =>
[password] => dasf
[email] => sdfhhh
)

Is This Answer Correct ?    0 Yes 0 No

1.What are the difference between echo , print , print_r ? else this 3 can we show output to a clie..

Answer / meenakshi

echo is a statement
while print is a function
we can't print whole array by using echo or print. For this
we have to use the print_r function

Is This Answer Correct ?    0 Yes 0 No

1.What are the difference between echo , print , print_r ? else this 3 can we show output to a clie..

Answer / blue chan

Both are different in spellings

Is This Answer Correct ?    0 Yes 2 No

1.What are the difference between echo , print , print_r ? else this 3 can we show output to a clie..

Answer / madhavan

echo is a pure string statement, print is a formatted
function like C language by these two we cannot print whole
objects. We can print the whole object like array using print_r.

Is This Answer Correct ?    12 Yes 18 No

1.What are the difference between echo , print , print_r ? else this 3 can we show output to a clie..

Answer / mad

They are all same in php8

Is This Answer Correct ?    8 Yes 21 No

Post New Answer

More PHP Interview Questions

What is lazy loading in php?

0 Answers  


What is the super method?

0 Answers  


how can refresh current page automatically, without press any button and anchor tag.

5 Answers  


Is php front end?

0 Answers  


Which cryptographic extension provide generation and verification of digital signatures?

0 Answers  






Tell me how can we connect to a mysql database from a php script?

0 Answers  


Does browser understand php?

0 Answers  


What is $_ get in php?

0 Answers  


What are hooks in php?

0 Answers  


hi here one small project given to me in an software company during interview. one page that would count down till 9pm (today means every day before 9pm it would count down to zero) this means there will show how many mins. sec. and hours are left till 9pm so it would be like 1 hr 20 mins 23 sec. then it up count down every sec and then show 1hr 20mins 22sec left till 9pm once the count down reaches zero it would show a flesh player video will autostart. the flash player will be from http://www.longtailvideo.com/players/jw-flv-player/ (the player is embed into the page.) that same page will track to see if they have already seen the video using php sessions then if they go back to that page it would redirect them to a new page saying that they have already wathed the video.

1 Answers  


How do you define a constant?

0 Answers  


Why do we need abstract class in php?

0 Answers  


Categories