PHP如何实现在网页刷新变色

请问各位老师 如何在我现有代码基础上 加上能实现自动改变颜色的代码 在网页每刷新一下就会换颜色 谢谢各位老师!

img

增加一个随机颜色的方法

function randColor(){
    $colors = array();
    for($i = 0;$i<6;$i++){
        $colors[] = dechex(rand(0,15));
    }
    return implode('',$colors);
}

在你想要使用的地方调用

<?php echo '<span style="color: #'.randColor().'">随机颜色:#'.randColor().'</span>';?>