Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $input1 = array(
- array(
- 'context' => 'aa',
- 'id' => 1,
- 'view' => 1,
- 'update' => 1,
- ),
- array(
- 'context' => 'bb',
- 'id' => 2,
- 'view' => 0,
- 'update' => 0,
- )
- );
- $input2 = array(
- array(
- 'context' => 'cc',
- 'id' => 3,
- 'view' => 0,
- 'update' => 1,
- ),
- array(
- 'context' => 'dd',
- 'id' => 4,
- 'view' => 0,
- 'update' => 0,
- ),
- array(
- 'context' => 'ee',
- 'id' => 5,
- 'view' => 1,
- 'update' => 0,
- )
- );
- $input3 = array(
- array(
- 'context' => 'ff',
- 'id' => 6,
- 'view' => 1,
- 'update' => 1,
- ),
- array(
- 'context' => 'gg',
- 'id' => 7,
- 'view' => 1,
- 'update' => 0,
- ),
- );
- $global = array($input1, $input2, $input3);
- foreach ($global as $input) {
- // Do stuff here to generate the output array given below...
- }
- $output = array(
- 'aa+1&cc+3&ff+6' => array('view' => 0, 'update' => 1),
- 'aa+1&cc+3&gg+7' => array('view' => 0, 'update' => 0),
- 'aa+1&dd+4&ff+6' => array('view' => 0, 'update' => 0),
- 'aa+1&dd+4&gg+7' => array(...),
- 'aa+1&ee+5&ff+6' => array(...),
- 'aa+1&ee+5&gg+7' => array(...),
- 'bb+2&cc+3&ff+6' => array(...),
- 'bb+2&cc+3&gg+7' => array(...),
- 'bb+2&dd+4&ff+6' => array(...),
- 'bb+2&dd+4&gg+7' => array(...),
- 'bb+2&ee+5&ff+6' => array(...),
- 'bb+2&ee+5&gg+7' => array(...)
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement