dunkov47 Posted September 7, 2009 Share Posted September 7, 2009 hi guys i need help, i have a webpage on localhost that basically is a website about php and other languages like rss, xlst anyway i need to display php code, html code etc on the webpage as examples for peope to view it. does anyone know how i can do this?? i have tried <pre> tags but they dont work, im a n00b at web development programming so sorry if this is easy question. oh and the files are saved as .php were the content will be shown. i have googled but i cant find a straight answer i need help for this today please as the assignment is due tomoro cheers Quote Link to comment Share on other sites More sharing options...
saltedm8 Posted September 7, 2009 Share Posted September 7, 2009 you need to use coding to create the " < > for example in html " will give you " < will give you < > will give you > so, if you wanted to write and opening php tag, it should be like this <?php Quote Link to comment Share on other sites More sharing options...
dunkov47 Posted September 7, 2009 Author Share Posted September 7, 2009 the ascii codes? that will take way to long... if i wana display a valid document and a dtd too it will take way to long... is there an easier way?? there as to be. i tried "example code" and 'example code' how my lecturer explained it to me but it dosnt work.. i tried text area aswell but the validator just sees it as code and gives errors Quote Link to comment Share on other sites More sharing options...
saltedm8 Posted September 7, 2009 Share Posted September 7, 2009 well, if you have dreamweaver you should be able to just paste the coding into the wysiwyg, and dreamweaver will automatically convert those symbols for you, that is the only way I can think of to get the job done faster, unless you can find a programme that will do it for you, but at the end of the day, that is the only way to get it on the page as far as I know without it being read as code Quote Link to comment Share on other sites More sharing options...
dunkov47 Posted September 7, 2009 Author Share Posted September 7, 2009 is there any way to do it in php code like for example <?php print "<xsl:template match==”/”> </xsl:template>"; ?> Quote Link to comment Share on other sites More sharing options...
saltedm8 Posted September 7, 2009 Share Posted September 7, 2009 Sorry, there probably is but I am just learning php myself.. maybe ask in one of the php forums Quote Link to comment Share on other sites More sharing options...
haku Posted September 8, 2009 Share Posted September 8, 2009 Yes, you can do it in php: $text_to_convert = '<html><head></head><body></body></html>'; $converted_text = htmlentities($text_to_convert); echo $converted_text; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.