How to print \ in php. Only \ with out using . or *.

Answers were Sorted based on User's Feedback



How to print \ in php. Only \ with out using . or *...

Answer / vijay

The answer is simple.

<?php print "\\"; ?>

I hope this coud help u.

Is This Answer Correct ?    4 Yes 3 No

How to print \ in php. Only \ with out using . or *...

Answer / swarnadip

Previous answer is correct but u can also use echo in place
of print

Is This Answer Correct ?    2 Yes 1 No

How to print \ in php. Only \ with out using . or *...

Answer / naresh

$something = "oh something";
echo "My answer is \\\"is"\\\ $something" <br/>;


output:"My answer \"is" \ oh something
when we declare single \ it escaped but when we double the \
it will display the single \.

Is This Answer Correct ?    0 Yes 0 No

How to print \ in php. Only \ with out using . or *...

Answer / malli

<?php echo "/"; ?>

Is This Answer Correct ?    0 Yes 0 No

How to print \ in php. Only \ with out using . or *...

Answer / gsrlingam

write like this
<?php print_r($varaible);?>
<?php echo $varaible;?>
<?php echo "String";?>

Is This Answer Correct ?    0 Yes 1 No

How to print \ in php. Only \ with out using . or *...

Answer / ram

i think the above answer is not correct.

i think this will work.
<?php print "\\";

Is This Answer Correct ?    0 Yes 2 No

How to print \ in php. Only \ with out using . or *...

Answer / vikas

<?php echo "\"?>

Is This Answer Correct ?    0 Yes 6 No

Post New Answer

More PHP Interview Questions

Suppose your Zend engine supports the mode <? ?> Then how can u configure your PHP Zend engine to support <?PHP ?> mode ?

4 Answers  


What is the difference between mysql_fetch_object and mysql_fetch_array?

10 Answers   Sarv,


What are magic methods in php

2 Answers   Net Solution,


What is "echo" in php?

0 Answers  


What difference between require() and require_once()?

0 Answers  


What is the use of namespace in php?

0 Answers  


How to concatenate two strings 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  


How we can retrieve the data in the result set of mysql using php?

0 Answers  


How can we access the data sent through the url with the post method?

0 Answers  


Write a program to get lcm of two numbers using php?

0 Answers  


Explain why would we use === instead of ==?

0 Answers  


Categories