String Replace

I want to do a string replace to replace any special character and spaces with a dash.

my url
[php][/php]

I want to run a string replace on [php]<?php echo $row_Recordset1['name']; ?>[/php]

Can anyone assist me with this?

here is my current output:
http://wwwdomain.com/sex-toys/Purple%20Mesh%20Thong/1843.html

Regards,
Josh

[php]
$mystring = β€˜http://srao.case.150/1 BHK+Balcony- 500+ sqft. spacious apartmetn Bandra Wes’;
$output = preg_replace("![^a-z0-9]+!i", β€œ-”, $url);
//$output is the result you needed.
echo $output;
[/php]
i hope this will help full for you.
reply your feedback.
SR

Sponsor our Newsletter | Privacy Policy | Terms of Service