Jump to content


What's the secret of pasting code into the forum?

  • Please log in to reply
1 reply to this topic

#1 ginerjm

  • Members
  • PipPipPip
  • Handball player
  • 4,016 posts
  • LocationVoorheesville NY

Posted 13 May 2017 - 10:00 PM

Use php tags:

foreach($myarray as $k=>$v)
echo "<label>My inputs</label>";
echo "<tr><td>$k</td><td$v</td></tr>";


Use code tags:

foreach($myarray as $k=>$v)
echo "<label>My inputs</label>";
echo "<tr><td>$k</td><td$v</td></tr>";

So using code tags drops the double spacing but neither one respects the indents in my code.

Edited by ginerjm, 13 May 2017 - 10:02 PM.

PS - If you're posting here you should be using:
        ini_set('display_errors', '1');

at the top of ALL php code while you develop it!

#2 cyberRobot

  • Moderators
  • Much to Learn
  • 2,764 posts

Posted 15 May 2017 - 12:55 PM

@ginerjm - So I moved your test post and modified the title.


To indent the code, do you use tabs? I usually need to change the tabs in my code to spaces.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users