tag:blogger.com,1999:blog-9105807667536228286.post316037517605832541..comments2024-03-09T05:35:22.812+01:00Comments on Developer Paradize: How To Remove Stop words From The String Using PHP?Anup Shakyahttp://www.blogger.com/profile/17559758035513914889noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-9105807667536228286.post-32198349917997860332015-04-17T13:25:52.760+02:002015-04-17T13:25:52.760+02:00Thank you so much for this, I was looking for a so...Thank you so much for this, I was looking for a solution whereby I didn't have to store the regular expression syntax as part of the word in the stop word array. Worked perfectly for me. Thanks again.Claire Mhttps://www.blogger.com/profile/15797406945659071815noreply@blogger.comtag:blogger.com,1999:blog-9105807667536228286.post-55435477207554811902014-09-11T09:18:37.912+02:002014-09-11T09:18:37.912+02:00Good Job.
You can remove stop words from the str...Good Job. <br /><br />You can remove stop words from the string using array_diff function as well.<br /><br />P:S: array_diff function returns an array containing all the entries from array1 that are not present in any of the other arrays.<br /><br />Cheers,<br />Anup Anup Shakyahttps://www.blogger.com/profile/17559758035513914889noreply@blogger.comtag:blogger.com,1999:blog-9105807667536228286.post-47947053638602929732014-09-10T18:28:17.984+02:002014-09-10T18:28:17.984+02:00strarray = array();
$strarray = explode(' '...strarray = array();<br />$strarray = explode(' ', $string);<br />$new_array_without_stopwords = array_diff($strarray, $stopwords);<br /><br />Arcelayhttps://www.blogger.com/profile/12622061238091642870noreply@blogger.com