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 / manpreet

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 ?    150 Yes 16 No

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

Answer / suja

echo is a language construct.print is a function.print_r
used to display the contents and structure of objects such
as array.

Is This Answer Correct ?    74 Yes 16 No

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

Answer / mahesh

echo is a statement where print_r,print are the functions
all prints 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 ?    47 Yes 8 No

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

Answer / navanee

$a=array("ford","benz","bmw","maruthi");
echo ($a);//output Array

$a=array("ford","benz","bmw","maruthi");
print_r ($a);//output Array ( [0] => ford [1] => benz [2] =>
bmw [3] => maruthi )

$a=array("ford","benz","bmw","maruthi");
print ($a);//output Array

Is This Answer Correct ?    30 Yes 5 No

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

Answer / pravendra

echo is a statement used to print the line.
while print and print_r is a function.
if take the example of array then
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 ?    20 Yes 6 No

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

Answer / haranath reddy

Echo is a statement used to diplay the data where as print
and print_r are the functions which can perform
tasks.print_r can perform the rotaions in a loop like for
statement.
Pirnt_r Especially used for structures like arrays and
classes.

Is This Answer Correct ?    13 Yes 6 No

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

Answer / dheeraj

echo is not a function which outputs one or more strings but
it cannot display the array contents, and print_r() is a
function which Prints human-readable information about a
variable

Is This Answer Correct ?    7 Yes 2 No

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

Answer / dheeraj

echo is not a function, but a statement which outputs one or
more strings, it cannot display the array contents where as
the print() and print_r() are functions. print() can even
display the array contents as an array . print_r() Prints
human-readable information about a
variable

Is This Answer Correct ?    4 Yes 0 No

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

Answer / muhammad babar bhatti

echo is a command for display a string or statement
print is a function for display a string or statement, but
it returns true/false also and print_r is also a function
that use to display an array data which we can not do
through the print function or echo statement.

Is This Answer Correct ?    5 Yes 2 No

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

Answer / saurabh kumar

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 ?    1 Yes 0 No

Post New Answer

More PHP Interview Questions

Write a program to find a string is palindrome or not?

0 Answers  


How to Retrieve video files in php from database.....and how to store video on database..

2 Answers  


How to generate a form?

0 Answers  


What are the options to transfer session ids?

0 Answers  


What enctype is required for file uploads to work?

0 Answers  


How you can update memcached when you make changes to php?

0 Answers  


What kind of variable is age?

0 Answers  


Can you use both this () and super () in a constructor?

0 Answers  


Is php a case sensitive language?

0 Answers  


How do I display php errors?

0 Answers  


What is the difference between query and question?

0 Answers  


<?php include ("db.php"); $result = mysql_query("SELECT ques_id FROM questionbank order by ques_id limit 5 "); while($obj=mysql_fetch_array($result)) { $ad1[$obj['ques_id']]++;//Used an array and inserted the database query results into it. } $rand_keys=array_rand($ad1,1); //Did a random array function echo "First random id = ".$ad1[$rand_keys[0]]; echo "<br>Second random id = ".$ad1[$rand_keys[1]]; ?> <!--Its not working. Have any solution for this. -->

1 Answers  


Categories