dink87522 Posted August 12, 2009 Share Posted August 12, 2009 I have a logn string of data, i.e. 44a542a43a453a1234a etc.. and are exploding it with 'a' as the break. However I only want 20 pieces of this data in my array (the first 20). How do I go about this? Link to comment https://forums.phpfreaks.com/topic/169960-solved-explode/ Share on other sites More sharing options...
Alex Posted August 12, 2009 Share Posted August 12, 2009 $arr = array_slice(explode('a', $str), 0, 20); Link to comment https://forums.phpfreaks.com/topic/169960-solved-explode/#findComment-896589 Share on other sites More sharing options...
dink87522 Posted August 12, 2009 Author Share Posted August 12, 2009 Thanks, that si exactly what I was after. Simpler than I thought it would be. Link to comment https://forums.phpfreaks.com/topic/169960-solved-explode/#findComment-896602 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.