The following code fetches the TITLE attribute for each post. I want to compare it to a search phrase $f using something similar to the way LIKE works with SQL.
<?php
$terms = $_GET['f'];
$searchs = get_posts($args);
foreach($searchs as $search){
$title = get_the_title($search);
Then we would need something like:
if($title is LIKE $f) { }
How would it work?
LIKE is a MySQL keyword, you have to use that in an SQL statement like so:
If you want to do your search using PHP, you can use strpos like so: