RenegadeFX
New member
San someone show me how to loop through an array to create a web safe colors table?
This is how I do it in Javascript.
var c=new Array('00','33','66','99','CC','FF');
for(i=0;i<c.length;i++) {
for(j=0;j<c.length;j++) {
for(k=0;k<c.length;k++) {
l=c+c[j]+c[k];
document.getElementById('ColorsDiv').innerHTML = l;
}
}
}
thats not a table but thats the Basic idea of It.
I just can't figure out how it works in PHP any help is appreciated.
Never mind I figured it out ha sorry about that.
here's what I got
$c=array('00','33','99','CC','FF');
for($i=0;$i<count($c);$i=$i+1) {
for($j=0;$j<count($c);$j=$j+1) {
for($k=0;$k<count($c);$k=$k+1) {
$l=$c[$i].$c[$j].$c[$k];
echo "$l <br />";
}
}
}
This is how I do it in Javascript.
var c=new Array('00','33','66','99','CC','FF');
for(i=0;i<c.length;i++) {
for(j=0;j<c.length;j++) {
for(k=0;k<c.length;k++) {
l=c+c[j]+c[k];
document.getElementById('ColorsDiv').innerHTML = l;
}
}
}
thats not a table but thats the Basic idea of It.
I just can't figure out how it works in PHP any help is appreciated.
Never mind I figured it out ha sorry about that.
here's what I got
$c=array('00','33','99','CC','FF');
for($i=0;$i<count($c);$i=$i+1) {
for($j=0;$j<count($c);$j=$j+1) {
for($k=0;$k<count($c);$k=$k+1) {
$l=$c[$i].$c[$j].$c[$k];
echo "$l <br />";
}
}
}