Well, I don't know why I can't figure this out. It should have taken a few minutes for me to do but I had a lot of trouble with my broadband connection last night while I was working on it and I think that my frustration has gotten the better of me.
By the way, the likelihood of me figuring this out after I explain it here is rather high. lol
Simply put, I want to apply the function htmlentities to every item in an array even if I don't know how many items in the array or more importantly, the names of the array keys. However, the task must maintain the array key names when finished since the keys are used later to process the data.
Basically, I'm working on a generic script that would allow me to use the same script over and over for many different HTML forms. Since this script just acts as an in between script that cleans the data before it is passed to the next step, I need it to maintain all of the array information except for modifying the values as needed.
Okay, so why not just clean each item as it is processed later?
Well, the sooner I clean the data, the smaller the chance of a problem. The next step of the process is where my biggest concern is as it provides the largest security concern.
In addition to the htmlentities function, I'll be running a few more data cleaning functions on the input to ensure the safety of the system.
Assume the following array type to be used:
Code:
$_POST['f_name'] = "John";
$_POST['l_name'] = "Doe";
$_POST['username'] = "jdoe";
$_POST['email'] = "jdoe@nowhere.bfe";
Thanks for the help.
vujsa