18-2.php3

来自「linux操作系统中 php 核心编程所有例程 都是一些很不错的案例」· PHP3 代码 · 共 44 行

PHP3
44
字号
<HTML>
<HEAD>
<TITLE>Figure 18-2</TITLE>
</HEAD>

<BODY>
<H1>Color Chart</H1>
<P>The following chart displays the colors
safe for displaying in all browsers.  These
colors should not dither on any computer
with a color palette of at least 256
colors.</P>
<P>This chart will only display on browsers
that support table cell background colors.</P>
<?
	$color = array("00", "33", "66", "99", "CC", "FF");

	for($Red = 0; $Red < count($color); $Red++)
	{
		print("<TABLE>\n");

		for($Green = 0; $Green < count($color); $Green++)
		{
			print("<TR>\n");
			
			for($Blue = 0; $Blue < count($color); $Blue++)
			{
				$CellColor = $color[$Red] . 
					$color[$Green] . $color[$Blue];

				print("<TD BGCOLOR=\"#$CellColor\">");
				print("<TT>$CellColor</TT>");
				print("</TD>\n");		
			}	

			print("</TR>\n");
		}	
		
		print("</TABLE>\n");
	}
?>
</BODY>

</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?