anarchoi Posted February 5, 2008 Share Posted February 5, 2008 hello, I have a field (called Buddylist) in my database that contains a few numbers that are separated by spaces. All i would like to do is count how many numbers are in this field but i'm a newbie and i couldn't come up with a working code could someone help me? Quote Link to comment https://forums.phpfreaks.com/topic/89510-solved-help-with-count/ Share on other sites More sharing options...
laffin Posted February 5, 2008 Share Posted February 5, 2008 ya want to know how many buddies are on someone elses list? or how many buddies are on yer list. for 1st) Have no clue for 2nd) explode the contents, and count items in array. Quote Link to comment https://forums.phpfreaks.com/topic/89510-solved-help-with-count/#findComment-458463 Share on other sites More sharing options...
mem0ri Posted February 5, 2008 Share Posted February 5, 2008 If it's a single field of numbers separated by spaces...run something like... $array = explode(" ", $field); $count = count($array); Quote Link to comment https://forums.phpfreaks.com/topic/89510-solved-help-with-count/#findComment-458488 Share on other sites More sharing options...
anarchoi Posted February 5, 2008 Author Share Posted February 5, 2008 If it's a single field of numbers separated by spaces...run something like... $array = explode(" ", $field); $count = count($array); thanks! was easier than i thought... hehe Quote Link to comment https://forums.phpfreaks.com/topic/89510-solved-help-with-count/#findComment-458552 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.