JAVASCRIPT
var lblname = "Location Details";
console.log(lblname.replace(/[/\. ,:-]+/g, "-"));
i got Result Location-Details
.. and as same opertaion how to do in php is there any php function available for this action?
You can use
<?php
$lblname ="Location Details";
echo preg_replace("/[\/\\. ,:-]+/","-",$lblname);
die;
?>
preg_replace will be what you need
echo preg_replace("/[\/\\. ,:-]+/","-",$lblname);