Jump to content


Photo

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


  • Please log in to reply
1 reply to this topic

#1 ginerjm

ginerjm
  • Members
  • PipPipPip
  • Handball player
  • 3,644 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.

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

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

#2 cyberRobot

cyberRobot
  • Moderators
  • Much to Learn
  • 2,627 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