I have
$name = "Apple iPad 2 (32 GB) Wi-Fi / 3G Black 9.7" Tablet - MC774LLA";
How can I replace any of the following ""!/.,"
with a "-"
once.
So it looks like
Apple-iPad-2-(32-GB)-Wi-Fi-3G-Black-9-7-Tablet-MC774LLA
Thanks
I have
$name = "Apple iPad 2 (32 GB) Wi-Fi / 3G Black 9.7" Tablet - MC774LLA";
How can I replace any of the following ""!/.,"
with a "-"
once.
So it looks like
Apple-iPad-2-(32-GB)-Wi-Fi-3G-Black-9-7-Tablet-MC774LLA
Thanks
try
$beautifulName = preg_replace('/[!\/.,\s\-]+/', '-', $name);