rand.6位数值dechex转换成16进制动态改变单元格颜色
2016-12-15 14:47
387 查看
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body> <?php //for循环rand6位数 再用dechex转换成16位进制形成6位的颜色编码 //每次刷新都会有不同的值 for($a=0;$a<10;$a++) { if($a<=5) { $rand.=dechex(rand(0,15)); } else { continue; } } ?> <table width="200" border="0" height="30" bgcolor="#<?php echo $rand; ?>"> <tr> <td> </td> </tr> </table> </body>
相关文章推荐
- SpringMVC+ajaxFileUpload上传图片 IE浏览器弹下载框问题解决方案
- Etcd恢复报错:error listing data dir: /var/lib/etcd/default.etcd
- solr4.2增量索引之同步(修改,删除,新增)
- java线程(Thread)基础篇——创建线程
- android studio 提示 Warning:Ignoring InnerClasses attribute for an anonymous inner class
- android 关于Bitmap压缩处理解析
- Android 自动更新 后代通知栏显示进度
- Rabbitmq基本框架和安装(1)
- 第十课 完整的Lua代码示例
- Fragment小Demo入门理解及与Activity通信
- Java:批量插入、修改数据到数据库中的用法
- 配置ssh-keygen比较具体比较小白的步骤
- CentOS 6.5安装配置Nginx
- 欢迎使用CSDN-markdown编辑器
- 方形图片,高度铺满,宽度居中裁剪
- Eclipse-Eclipse常用快捷键
- entOS查看CPU、内存、网络流量和磁盘 I/O
- linux mysql 忘记密码 怎么修改密码
- asp.net中webForm验证码
- Linux部署Apache ActiveMQ 5.14.2启动报错