Hi, i have a checkbox element returning over 50 checkboxes for the user to check (it's a list for employees who received a training). So everything is fine, the element retrieve the employees list from database and display all names with checkbox in front of them.
The person who gives the training just check which employees had follow the training, and can come back later to add another employee just by checking his name.
My problem is that i would like to display on a page the name of every employees who had follow 1 particular training, so i need to retrieve the names from the database which are stored like this :
So i use a calc element with the following code:
But my problem is that i have this as a result:
John Test
Jack Test
Henry Test
Dennis Test
John%20Test
Jack%20Test
Henry%20Test
Dennis%20Test
So can someone point me in the right direction cause i would like to learn the right syntax to only have the first 4 result... not the last four with the %20 that replace space... why do i get those ?
Thanks for your help !
rodeokid
The person who gives the training just check which employees had follow the training, and can come back later to add another employee just by checking his name.
My problem is that i would like to display on a page the name of every employees who had follow 1 particular training, so i need to retrieve the names from the database which are stored like this :
Code:
["John Test","Jack Test","Henry Test","Dennis Test"]
So i use a calc element with the following code:
Code:
$checkbox = '{liste_des_formations___employes}';
$checkboxvalue = json_decode($checkbox);
foreach(array_keys($checkboxvalue) as $key) {
echo $checkboxvalue[$key]."<br />";
}
But my problem is that i have this as a result:
John Test
Jack Test
Henry Test
Dennis Test
John%20Test
Jack%20Test
Henry%20Test
Dennis%20Test
So can someone point me in the right direction cause i would like to learn the right syntax to only have the first 4 result... not the last four with the %20 that replace space... why do i get those ?
Thanks for your help !
rodeokid