Raised This Month: $ Target: $400
 0% 

print HTML Escape Characters on webpage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
am_amx
Senior Member
Join Date: Jul 2010
Location: here
Old 12-17-2010 , 10:39   print HTML Escape Characters on webpage
Reply With Quote #1

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


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

Last edited by am_amx; 12-17-2010 at 10:57.
am_amx is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 12-17-2010 , 10:57   Re: print HTML Escape Characters on webpage
Reply With Quote #2

&amp;copy
Seta00 is offline
am_amx
Senior Member
Join Date: Jul 2010
Location: here
Old 12-17-2010 , 11:01   Re: print HTML Escape Characters on webpage
Reply With Quote #3

Quote:
Originally Posted by Seta00 View Post
&amp;copy
thanx for reply it worked,but i was thinking there would be any thing like / in html to avoid printing it
am_amx is offline
SeToY
SourceMod Donor
Join Date: Jul 2006
Location: Germany
Old 12-17-2010 , 11:33   Re: print HTML Escape Characters on webpage
Reply With Quote #4

Code:
<?php
$str='&copy;'
$escaped_html=htmlentities($str);
?>
__________________
Success is a lousy teacher. It seduces smart people into thinking they can't lose.
- Bill Gates

Quote:
Originally Posted by Hawk552
SeToY is a retard, scumbag and asshole and you shouldn't pretend that he isn't.
SeToY is offline
8088
Veteran Member
Join Date: Jan 2008
Old 12-17-2010 , 12:59   Re: print HTML Escape Characters on webpage
Reply With Quote #5

Quote:
Originally Posted by am_amx View Post
thanx for reply it worked,but i was thinking there would be any thing like / in html to avoid printing it
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.
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-17-2010 , 17:55   Re: print HTML Escape Characters on webpage
Reply With Quote #6

Quote:
Originally Posted by am_amx View Post
thanx for reply it worked,but i was thinking there would be any thing like / in html to avoid printing it
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.
__________________

Last edited by fysiks; 12-17-2010 at 18:01.
fysiks is offline
am_amx
Senior Member
Join Date: Jul 2010
Location: here
Old 12-17-2010 , 21:09   Re: print HTML Escape Characters on webpage
Reply With Quote #7

thanx to all for replies
am_amx is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:27.


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