simple question

A

Anonymous

Guest
Hi,

I am wondering what is / for in this coding,, i seen a lot of samples of php source code do have this,,

e.g:
echo "<td width=\"6%\" valign=\"top\"><div align=\"center\"><font size=\"2\" face=\"Arial, Helvetica, sans-serif\"><strong>Code</strong></font></div></td>";


<a href =\"view.php?id".$myrow[id]."\">view</a>


I was told that we need to use this when we include html code in php file... but i am still not really understand the usage of / in the php coding.. :?

please advise.
 
Hello,
From the code it seems you are intereseted in \ and not /

Anyways
/ is used in html to close the tag eg. </font>, <br />
The XHTML specification says every tag has to be closed

The \ is used as an escape charecter, eg. if you use
Code:
<?php echo ("I want to see \")?>
U will get output as "I want to see" and not "I want to see \"

So to use special charecters in strings, usage of backslash is done

Code:
<?php echo ("I want to see \\")?>

Will print "I want to see \"
 
Back
Top