Support the ongoing development of Laravel.io →
Input Testing
Last updated 1 year ago.
0

I found my answer, this is my result:

// Get my 2 array's and put them in a variable 
$januari = (array)$_GET["jan"];
$januaridat = (array)$_GET["date"];

//Get the number of array keys so i can loop with that number
$countkeytot = count((array_keys($januari)));

//Start the loop to check wich ones are selected
for ($i=0; $i<$countkeytot;$i++){
    if ($januari[$i] == 'on'){
	    echo "januari is selected<br>";
            print_r($januaridat[$i])
    }
    else{
	    echo 'januari is NOT selected<br>';
    }
}

This code works fine so far and the output is right, the only thing i still need is when januari is selected i can display the dates that correspond with the checkboxes. Herebeneath my output so far:

Array ( [0] => off [1] => off [2] => off [3] => on [4] => on [5] => on ) 
Array ( [0] => 02-02-2002 [1] => 01-01-2001 [2] => 03-03-2003 [3] => 05-05-2005 [4] => 04-04-2004 [5] => 06-06-2006 ) 
januari is NOT selected
januari is NOT selected
januari is NOT selected
januari is selected
05-05-2005
januari is selected 
04-04-2004
januari is selected 
06-06-2006
Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.