How can I detect the dot at the beginning of ".net"
with a preg_match_all
pattern so I can also echo ".net"
from the $skills
list as well as the others keywords?
$skill = array(".net","software framework","microsoft");
$text = ".NET Framework is a software framework developed by Microsoft";
foreach ($skill as $skills) {
preg_match_all("~\b$skills\b~i", $text, $matchWords);
foreach ($matchWords[0] as $matchWord) {
echo "<b>MatchWord:</b> " . $matchWord. "<br>";
}
}
Output (I'm Missing .NET): MatchWord: software framework MatchWord: Microsoft