1
$filter = 'id,name,questions.fields(id,text,options.limit(5).offset(3).fields(id,text),type).limit(10).offset(2),create_date';

I want to parse $filter like this. ($filter value is dynamic.)

$fields = array(
    'id',
    'name',
    'questions'=>array(
        'fields'=>array(
            'id',
            'text',
            'options'=>array(
                'fields'=>array(
                        'id',
                        'text'
                    ),
                'limit'=>5,
                'offset'=>3
            ),
            'type'
        ),
        'limit'=>10,
        'offset'=>2
    ),
    'create_date'
);

How can I do this?

Carl Veazey
  • 18,392
  • 8
  • 66
  • 81
Zeki Unal
  • 11
  • 1

0 Answers0