maddogandnoriko Posted March 11, 2009 Share Posted March 11, 2009 I have an array with say 100 elements. I need to execute code on it for the first 50 elements and then cut them off and execute the code on the last 50. I think what I need is something like and array_shift but for 50 elements. Thank you for your help. todd Link to comment https://forums.phpfreaks.com/topic/149002-solved-cut-x-number-off-array/ Share on other sites More sharing options...
Mchl Posted March 11, 2009 Share Posted March 11, 2009 array_chunk ? array_slice ? Link to comment https://forums.phpfreaks.com/topic/149002-solved-cut-x-number-off-array/#findComment-782387 Share on other sites More sharing options...
redarrow Posted March 11, 2009 Share Posted March 11, 2009 http://uk2.php.net/array_splice sorry array chunk easy way. Link to comment https://forums.phpfreaks.com/topic/149002-solved-cut-x-number-off-array/#findComment-782389 Share on other sites More sharing options...
maddogandnoriko Posted March 11, 2009 Author Share Posted March 11, 2009 Thanks Guys! Any of those solutions will work, have to see what fits best. Thank you very much! Link to comment https://forums.phpfreaks.com/topic/149002-solved-cut-x-number-off-array/#findComment-782411 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.