I'm having problems finding a way to solve this one:
Code: Select all
$value = "CMC Concept";
$strFirmenname = "CMC Conceptagentur fuer Marketing und Communication GmbH";
// Get rid of more than one space
$pattern = "/(ї ]{2,})/";
$replacement = " ";
$strFirmenname = preg_replace($pattern, $replacement, $strFirmenname);
$value = preg_replace($pattern, $replacement, $value);
echo "$value<br>";
echo "$strFirmenname<br>";
if (preg_match("/\\$value/i", $strFirmenname)) {
echo "A match was found.<br>";
}
else {
echo "A match was _not_ found.";
}--------
A match was found.
Another input:
----------------
Now suppose $value holds another string:
$value = "CMC Concept - Testsatz steht hier";
$strFirmenname = "CMC Conceptagentur fuer Marketing und Communication GmbH";
=> Logically 'A match was _not_ found.' is outputed
Question:
-----------
How can I find a string which is in both of $value and $strFirmenname?
Here it would e.g. be 'CMC Concept'. I actually have no idea how I can solve that. I suppose there is no php function which brings in the function I need...
Appreciate any help! Thanks!