note 24012 modified in function.show-source by maxim

From: Date: Sun, 04 Aug 2002 00:57:36 +0000
Subject: note 24012 modified in function.show-source by maxim
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-34247@lists.php.net to get a copy of this message
[editors note: str_pad() function could be a rather elegant solution] Not to sound picky or anything, but the first example of the line-numbering is great, but this is the one change that (in my opinion) makes it perfect: $source[$i] = "<code>[$i]".str_repeat("<span style=\"color: #ffffff\">0</span>", 4 - strlen ($i))."</code>$source[$i]<br />"; That combines the second comment of not setting the lines crooked and the original idea into one. The zeros used as placeholders are matched to the background-color (white, usually...) so you don't have to stare at them. --was-- Not to sound picky or anything, but the first example of the line-numbering is great, but this is the one change that (in my opinion) makes it perfect: $source[$i] = "<code>[$i]".str_repeat("<span style=\"color: #ffffff\">0</span>", 4 - strlen ($i))."</code>$source[$i]<br />"; That combines the second comment of not setting the lines crooked and the original idea into one. The zeros used as placeholders are matched to the background-color (white, usually...) so you don't have to stare at them. http://www.php.net/manual/en/function.show-source.php

« previous php.notes (#34247) next »