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 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 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.'; 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... 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... 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 Link to comment https://forums.phpfreaks.com/topic/55397-solved-stupid-question/#findComment-273779 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.