Forum Moderators: coopster
$cut = substr($listing['name'], 0, strpos($listing['name'], '-'));
$cut = substr($listing['name'], strpos($listing['name'], '-'));
I removed the "length" parameter and made the start position where it finds the hyphen. Just curious, though, because you can actually use strstr to do this same thing. I thought you wanted to string before the hyphen, and that's why I suggested the use of substr.
$cut = trim(substr($listing['name'], strpos($listing['name'], '-')+1));
$cut = trim(strstr($string, '-'),'-');