I want to shorten an array so it only contains 30 elements. If for example I have an array of 100 elements is it possible to take it and chop of (as to speak) 70 of those elements?
+7
A:
http://php.net/manual/en/function.array-slice.php
Usage:
$shortarray = array_slice($longarray, 0, 30);
Yorirou
2010-08-19 10:29:36
+1 for quickness
Richa
2010-08-19 10:31:33
@Gordon: sorry, I added an example.
Yorirou
2010-08-19 11:17:51