I use this code that is to return data for each searched name, but the query only works if I type a name identically, I wanted to type "Smartphone" and it returns all searches that have this word in the title. Can you help me?
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>" >
Nome <input type="text" name="nome" value="" />
<input type="submit" name="submit" />
</form>
<?php
if (isset($_POST['submit'])) {
$xml = simplexml_load_file('https://actionpay.net/br-pt/couponFeed/xmlFilter/id:6607');
$erro = 0;
foreach ($xml->promotion AS $val) {
if ($val->title == $_POST['nome']) {
echo "<div class='single-product'>
<div class='product-f-image'>
<div class='product-hover'>
<a href='$val->offer_link' class='add-to-cart-link' target='_blank'><img src='$val->logo' alt=''>$val->title</a>
</div>
</div>
<div class='product-carousel-price'>
<del></del>
</div>
</div>";
$erro++;
}
}
if ($erro == 0) {
echo "nenhum valor encontrado";
}
}
?>