olli460 Posted September 24, 2009 Share Posted September 24, 2009 Hello, Ive got a database and im storing a list of IDs in one field like 15, 26, 55 They are the IDs of the videos they have added to their favorites. How can i split these up and display them back to the user? Quote Link to comment https://forums.phpfreaks.com/topic/175347-solved-favorite-list-how-to-sort-lots-of-numbers-from-one-field/ Share on other sites More sharing options...
Adam Posted September 24, 2009 Share Posted September 24, 2009 $ids = explode(',', $id_str); foreach ($ids as $id) { echo trim($id) . '<br />'; } Quote Link to comment https://forums.phpfreaks.com/topic/175347-solved-favorite-list-how-to-sort-lots-of-numbers-from-one-field/#findComment-924050 Share on other sites More sharing options...
olli460 Posted September 24, 2009 Author Share Posted September 24, 2009 Perfect. Thanks alot! Quote Link to comment https://forums.phpfreaks.com/topic/175347-solved-favorite-list-how-to-sort-lots-of-numbers-from-one-field/#findComment-924055 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.