php_guest Posted January 20, 2009 Share Posted January 20, 2009 I have one simple question: How do you post a code inside post? I don't mean like this <php echo ...?> but properly to looks like in editor. Quote Link to comment https://forums.phpfreaks.com/topic/141666-how-to-put-the-code-inside-post/ Share on other sites More sharing options...
Zane Posted January 20, 2009 Share Posted January 20, 2009 do you mean like this echo "Use the PHP tags"; ?> use the PHP BBcode tag [code=php:0]Your code here [/code] Quote Link to comment https://forums.phpfreaks.com/topic/141666-how-to-put-the-code-inside-post/#findComment-741573 Share on other sites More sharing options...
php_guest Posted January 20, 2009 Author Share Posted January 20, 2009 just testing <?php echo "Use the PHP tags"; ?> thanks, it works. Quote Link to comment https://forums.phpfreaks.com/topic/141666-how-to-put-the-code-inside-post/#findComment-741634 Share on other sites More sharing options...
revraz Posted January 21, 2009 Share Posted January 21, 2009 Also, if you do a full Reply and not a quick one, you get some icons that includes a # sign that will enter the code tags for you. Quote Link to comment https://forums.phpfreaks.com/topic/141666-how-to-put-the-code-inside-post/#findComment-742199 Share on other sites More sharing options...
Maq Posted January 21, 2009 Share Posted January 21, 2009 do you mean like this echo "Use the PHP tags"; ?> use the PHP BBcode tag [code=php:0]Your code here [/code] I wouldn't use the [.php] tags because if you ever CnP long code from it, there seems to be large amounts of linebreaks. I always use the regular [.code] tags and just encapsulate my code with <?php ?> tags. Quote Link to comment https://forums.phpfreaks.com/topic/141666-how-to-put-the-code-inside-post/#findComment-742219 Share on other sites More sharing options...
kenrbnsn Posted January 21, 2009 Share Posted January 21, 2009 BTW, there is a way to write the string so it is treated as a plain string without putting spaces or other useless characters in it. Just use the [nobbc][/nobbc] tags like I do: Please use tags when posting code is actually typed as Please use [nobbc] [/nobbc] tags when posting Ken Quote Link to comment https://forums.phpfreaks.com/topic/141666-how-to-put-the-code-inside-post/#findComment-742456 Share on other sites More sharing options...
revraz Posted January 21, 2009 Share Posted January 21, 2009 Thats a nice tip. Quote Link to comment https://forums.phpfreaks.com/topic/141666-how-to-put-the-code-inside-post/#findComment-742466 Share on other sites More sharing options...
Maq Posted January 21, 2009 Share Posted January 21, 2009 BTW, there is a way to write the string so it is treated as a plain string without putting spaces or other useless characters in it But then when you quote, it doesn't recognize the [nobbc][/nobbc] tags ;( Plus, it's easier to add a period or space in. Quote Link to comment https://forums.phpfreaks.com/topic/141666-how-to-put-the-code-inside-post/#findComment-742474 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.