Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 foreach loop in php?

0 Answers  


explain the changes in php version

3 Answers  


How to include variables in double-quoted strings in php?

0 Answers  


What is singleton class in php?

0 Answers  


What new features php7 has in store for us?

0 Answers  


What is different types of visibility?

0 Answers  


How to write php function in html onclick?

0 Answers  


List some string function name in php?

0 Answers  


Why do we use csrf token?

0 Answers  


Which is better php praogramming or cad/cam scope wise and also salaray wise?

0 Answers  


How long does a session last in php?

0 Answers  


what are the rules to be followed at the time of declaring a variable?,what is the purpose of var_dump()function in php,syntax of ternary operator()in php,difference between drop a table and truncate a table...

2 Answers  


Categories