canelones canelones - 1 year ago 52
PHP Question

Remove first 100 element of variable?

I have this code which stores values in $products. I'm not sure if $products is an array or other thing.

I need to remove the first 100 values.

// Get all products
$products = Product::getProducts(1, 0, 1000000, 'id_product', 'DESC', false, true, $context);

Answer Source
if (is_array($products))
  $products = array_slice($product, 100);

Refer to this page to get in deep.