Quote:
Originally Posted by awuehr
Hi Benton,
Please let me know it this works, I am not really shure.
Greetings,
Alex
|
Thanks for the suggestion. I hadn't thought of getting an array from the form and it is better than what I had. I've done that before using the serialize function so coding it isn't a problem. But that wasn't really the part I was having a problem with, or maybe I don't fully understand your solution.
Let's say there is one class in the css file so when the file is read in, the array will appear as
Code:
Array
(
[0] => Array
(
[0] => #nav, #nav ul {
[1] => float: left;
[2] => width: 58em;
)
}
When the array is then created from the form, it would appear as
Code:
$_POST['nav'] = array(
'float' => 'some value',
'width' => 'some value'
);
What I am failing to see is how to transfer the elements of the second array into the first. The
Code:
[0] => #nav, #nav ul
entry would have to stay the same since that is the actual class name and is required for proper operation. Do I just walk through both arrays and set the items after that? Something like
Code:
foreach ($1stArray as $array) {
foreach ($array as $k => $d) {
$d = $2ndArray[ I don't know what goes here]
I suppose that if I named the form elements with the actual class name, then I could just use the new array read from the form. Is having a form element setup like the following considered valid code?
Code:
<input type="text" name="#nav, #nav ul {"
I hope the above explained the problem I am having a little better.