- trim: documentation ( source)
- preg_replace: documentation ( source)
- strtolower: documentation ( source)
<?php
$name = 'Fortress 3-1/2" White Flexible Elbow 40" Long LF92W';
$str = strtolower(trim(preg_replace('/[^a-zA-Z0-9]+/', '-', $name), '-'));
echo $str. "\n";
?>