Topic: array_push

Hi guys

I'm using xajax 0.5 and php 5

The problem I'm having is that array_puch doesn't seem to work. Unfortunately I'm not receiving an error message my function just doesn't execute.
I know the problem lies with the array_puch because if I take it out all works fine again.
I’m getting an array from a form, and then  testing if a certain key exists, if it doesn’t I want to add it to my array.
My existing code is as follow:

$employee= $ajax_array["employee"];
if (!isset($employee)){array_push($ajax_array['employee'], 'off');}

Unless I’, blind (hehe) there is nothing wrong with my code (I hope). So I have no idea why my function does not want to execute.
The reason I’m doing this is I have a form where I can update information. $employee in my code above is a checkbox so if not checked on the form it’s like it doesn’t exist so I can’t update it on the next page.
Any suggestions on how to handle the checkbox or why my code for array_puch doesn’t work?


Re: array_push



$employee_blasting_ticket = $ajax_array["employee_blasting_ticket"];
if (!isset($employee_blasting_ticket)){$ajax_array['employee_blasting_ticket'] = 'off';}