var base64 = new Encodeutil.Base64Binary("");
lstApplicableSubs = new Array(lstCategories.length);
for (var i = 0; i < lstApplicableSubs.length; i++) lstApplicableSubs[i] = new Array();
for (i = 0; i < lstSubCategories.length; i++)
{
var map = base64.decode(lstSubCategories[i].validFor);
for (var j = 0; j < lstCategories.length; j++)
{
var bits = map.charCodeAt(j >> 3);
if ((bits & (0x80 >> (j & 0x07))) != 0) lstApplicableSubs[j].push(lstSubCategories[i]);
}
}
Can anyone help convert this to PHP?
Below is var_export for object :
stdClass::__set_state(array(
array (
0 =>
stdClass::__set_state(array(
'label' => 'Category',
'name' => 'Category',
'optionslist' =>
array (
0 =>
stdClass::__set_state(array(
'label' => 'Category1',
'value' => 'Category1',
)),
1 =>
stdClass::__set_state(array(
'label' => 'Category2',
'value' => 'Category2',
)),
2 =>
stdClass::__set_state(array(
'label' => 'Category3',
'value' => 'Category3',
)),
3 =>
stdClass::__set_state(array(
'label' => 'Category4',
'value' => 'Category4',
)),
)),
1 =>
stdClass::__set_state(array(
'label' => 'Sub Category',
'name' => 'Sub_Category',
'optionslist' =>
array (
0 =>
stdClass::__set_state(array(
'label' => 'SubtCategory1',
'validFor' => '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '',
'value' => 'SubtCategory1',
)),
1 =>
stdClass::__set_state(array(
'label' => 'SubtCategory2',
'validFor' => '' . "\0" . '' . "\0" . '',
'value' => 'SubtCategory2',
)),
),
))
var bits = map.charCodeAt(j >> 3); if ((bits & (0x80 >> (j & 0x07))) != 0)i have not experice of working with that kind of code.