- trim: documentation ( source)
- preg_replace: documentation ( source)
- strtolower: documentation ( source)
<?php
$name = 'SlimDuct 78" x 3-3/4" White Length of Line Set Ducting SD100W';
$str = strtolower(trim(preg_replace('/[^a-zA-Z0-9]+/', '-', $name), '-'));
echo $str. "\n";
?>