Hi there,
If I have "JoeSchmoe - White Sox Rock", is there a way for me to have the script remove all the characters after the "-"?
$string = 'JoeSchmoe - White Sox Rock'; $pos = strpos($string, '-'); if ($pos !== FALSE) { $string = substr($string, 0, $pos); } echo $string;
that will remove anything after the char if its present.