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? Quote Link to comment 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); Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.