HAVOCWIZARD Posted June 13, 2007 Share Posted June 13, 2007 how can i coun t how many words or values are in this array. if i do this $find = "car wash new york"; $find2= explode(" ", $find); i know it is stupid but i have to know how many words are used in the search, if anybody can help, thanks Quote Link to comment https://forums.phpfreaks.com/topic/55397-solved-stupid-question/ Share on other sites More sharing options...
Wuhtzu Posted June 13, 2007 Share Posted June 13, 2007 To count the number of entries in an array use count() $find = "car wash new york"; $find2= explode(" ", $find); $count = count($find2); //$count will be 4 Quote Link to comment https://forums.phpfreaks.com/topic/55397-solved-stupid-question/#findComment-273775 Share on other sites More sharing options...
Yesideez Posted June 13, 2007 Share Posted June 13, 2007 Use count(). echo 'There are '.count($find2).' elements.'; Quote Link to comment https://forums.phpfreaks.com/topic/55397-solved-stupid-question/#findComment-273776 Share on other sites More sharing options...
HAVOCWIZARD Posted June 13, 2007 Author Share Posted June 13, 2007 nope get value of one if i use $count = count($find2); //$count will be 4 let me try the other one... Quote Link to comment https://forums.phpfreaks.com/topic/55397-solved-stupid-question/#findComment-273777 Share on other sites More sharing options...
HAVOCWIZARD Posted June 13, 2007 Author Share Posted June 13, 2007 same thing tells me one only... Quote Link to comment https://forums.phpfreaks.com/topic/55397-solved-stupid-question/#findComment-273778 Share on other sites More sharing options...
HAVOCWIZARD Posted June 13, 2007 Author Share Posted June 13, 2007 sorry its just me being stupid had it higher up also to explode, i really getting old now, thanks guys...lol Quote Link to comment https://forums.phpfreaks.com/topic/55397-solved-stupid-question/#findComment-273779 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.