A couple more ways:
<?php
// If you mean ternary operator, than this
$component = (false === strpos($component, '*')) ? $component : str_replace('*', '%', $component);
// I prefer this, it's more readable {braces optional}
if (strpos($component, '*') !== false) {
$component = str_replace('*', '%', $component);
}
// Or just this, see below
$component = str_replace('*', '%', $component);
?>
This assumes that more often then not there will not be a replacement otherwise just use str_replace without any strpos check as it won't hurt.
strstr is less efficient than strpos as it returns a string instead of of a simple integer so using a strict === or !== is the right idea here. The difference of course depends on the size of $component.