how to print the first two items in a list in php code example Example: limit offset array php array_slice($array, 0, 50); // same as offset 0 limit 50 in sql