Page 1 of 1

Get foreach-result separated

Posted: 12 Feb 2021, 05:44
by JanMolendijk
Plessant Coursesweb
I`m still busy to read out colors my first tryout did not work.


In foreach code below I getting 20 results in once,
But I would like to have them separated into a code

Code: Select all

<?php
foreach ( $colors as $hex => $count )
{
	if ( $count > 0 )
	{
		echo "".$hex."";
	}
}
?>

Get foreach-result separated

Posted: 12 Feb 2021, 07:10
by MarPlo
Hello,
I didn't understand.
What data do you have in the $colors array, and what is the result you want to get.

Get foreach-result separated

Posted: 14 Feb 2021, 17:00
by JanMolendijk
Marplo, I coming back some later time on it.
Because I need to re-study the script.... Also, because the data from $colors (excuse).