I am trying to figure out how to search in php for substring. When I tried using this:
while ($row = db_fetch_array($results)) {
if(strpos($row['field_rep_contact_name_value'], $get)) {
$names['suggestions'][] = $row['field_rep_contact_name_value'];
}
}
I found that when the $get value was 'arm', it returned true for strings which had 'ar', I only want it to return true if it contains 'arm', the full value of the $get variable. I think this can be done with regex but not exactly sure how.
$getis contained in$row['field_rep_contact_name_value']or if they match exactly?