Forum Moderators: coopster
Sorry, never did something like it in PHP.
<?php
$selected = "best disscussion forums";$var = "WW is one of the best disscussion forums in world";
$sel_arr = explode(" ",$selected);
$words = explode(" ",$var);$all = count($words)-1;
function inSelected($word,$sel)
{
if (in_array($word,$sel))
{
return $word.',';
}
}foreach($words as $key => $word)
{
echo inSelected($word,$sel_arr);
}
?>