doforumda Posted August 13, 2011 Share Posted August 13, 2011 Hi, I am getting description column from mysql db. In that description I have codes such php code. and that code is surrounded by a code /code words. So how can I display that code in proper format? Please help. Quote Link to comment https://forums.phpfreaks.com/topic/244679-need-help-about-displaying-code/ Share on other sites More sharing options...
ohdang888 Posted August 13, 2011 Share Posted August 13, 2011 thats a CSS styling issue, not php examples: http://www.google.com/search?client=safari&rls=en&q=css+%3Ccode%3E&ie=UTF-8&oe=UTF-8#sclient=psy&hl=en&safe=off&client=safari&rls=en&source=hp&q=css%20style%20code%20block&pbx=1&oq=css%20style%20code&aq=1&aqi=g3g-m2&aql=&gs_sm=sc&gs_upl=5728l7491l0l9339l12l8l0l1l1l0l221l910l2.4.1l7l0&bav=on.2,or.r_gc.r_pw.r_cp.&fp=fa292ea85790151c&biw=1276&bih=684&pf=p&pdl=300 Quote Link to comment https://forums.phpfreaks.com/topic/244679-need-help-about-displaying-code/#findComment-1256793 Share on other sites More sharing options...
doforumda Posted August 13, 2011 Author Share Posted August 13, 2011 ok but how can I get that particular code which I want to put it in code snipet. for example below is the whole blog Here is we can out put string in php echo "Hello world"; So in above example I want to display "Here is how we can output string in php" normally but when it reaches to 'echo "Hello world"' then it must be put in code snippet. So how can I manage this behavior? Quote Link to comment https://forums.phpfreaks.com/topic/244679-need-help-about-displaying-code/#findComment-1256798 Share on other sites More sharing options...
jcbones Posted August 13, 2011 Share Posted August 13, 2011 http://php.net/manual/en/function.highlight-string.php I believe that is the function you are looking for. Quote Link to comment https://forums.phpfreaks.com/topic/244679-need-help-about-displaying-code/#findComment-1256820 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.