Pass offset and limit in Drupal embed view I am having below code to embed a view

$view=views_get_view('questions');
$view-&gt;set_display('block');

// execute view
$view-&gt;execute();
$viewArray = $view-&gt;result;


How do I set an offset in this? So that I can get the content I need?

I will be displaying a set of content in a page after processing it. I will need to skip first contents sometime. Like skip first 1 sometime or first 3 some other time.
| skip first 1 sometime or first 3 some other time.

Is there a reason you can't do this in the view? If you use a pager you can specify an on offset in pager options.

If you need to do this in code, you do something like:

$view=views_get_view('questions');
$view-&gt;display['block']-&gt;display_options['pager']['options']['offset'] = 'OFFSET NUMBER';
$view-&gt;execute_display('block'));