AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Off-Topic (https://forums.alliedmods.net/forumdisplay.php?f=15)
-   -   print HTML Escape Characters on webpage (https://forums.alliedmods.net/showthread.php?t=145535)

am_amx 12-17-2010 10:39

print HTML Escape Characters on webpage
 
hi
i want to print &copy on webpage instead of copyright symbol on first instance in the following code , but i'm getting copyright symbol twice

http://i54.tinypic.com/1581gu8.jpg
PHP Code:

<html>
<
head>
<
title>HTML Escape Characters</title>
</
head>
<
body>
 <
prethis will show copyright  &copy &copy;</pre>
</
body>
</
html


Seta00 12-17-2010 10:57

Re: print HTML Escape Characters on webpage
 
&amp;copy

am_amx 12-17-2010 11:01

Re: print HTML Escape Characters on webpage
 
Quote:

Originally Posted by Seta00 (Post 1372817)
&amp;copy

thanx for reply it worked,but i was thinking there would be any thing like / in html to avoid printing it :oops:

SeToY 12-17-2010 11:33

Re: print HTML Escape Characters on webpage
 
Code:

<?php
$str='&copy;'
$escaped_html=htmlentities($str);
?>


8088 12-17-2010 12:59

Re: print HTML Escape Characters on webpage
 
Quote:

Originally Posted by am_amx (Post 1372818)
thanx for reply it worked,but i was thinking there would be any thing like / in html to avoid printing it :oops:

Not sure what you're looking for, but commenting in HTML is done by using this:
HTML Code:

<!--
comment
-->

And don't forget to declare a doctype and character encoding.

fysiks 12-17-2010 17:55

Re: print HTML Escape Characters on webpage
 
Quote:

Originally Posted by am_amx (Post 1372818)
thanx for reply it worked,but i was thinking there would be any thing like / in html to avoid printing it :oops:

There is no "escape" character for HTML like you see in programming languages. Seta's solution is the solution.

In HTML it's more like encoding characters with the & and related reference. See here for common symbols.

am_amx 12-17-2010 21:09

Re: print HTML Escape Characters on webpage
 
thanx to all for replies


All times are GMT -4. The time now is 01:33.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.