You have to move your )
more to the right.
The str_replace
method takes 3 parameters (actually 4 but the forth is not important now).
You call it like str_replace(' ', '_')
.
I think you need this:
$manufacturerName = $_product->getAttributeText('manufacturer');
echo strtolower(str_replace(' ', '_', $manufacturerName));