String comparison in PHP seems little difficult. I don't know if any other ways to do it.
For example say:
$t1 = "CEO";
$t2 = "Chairman";
$t3 = "Founder";
$title = "CEO, Chairman of the Board";
if (!strcmp($t1, $title)) {
echo $title."<br>"; echo $Fname."<br>"; echo $Lname."<br>";
} else if (!strcmp($t2, $title)) {
echo $title."<br>"; echo $Fname."<br>"; echo $Lname."<br>";
} else if (!strcmp($t3, $title)) {
echo $title."<br>"; echo $Fname."<br>"; echo $Lname."<br>";
}
This isn't giving any result as above $title
has word $t1
and $t2
in it. How can I do this?