Below is my code in javascript that remove special character using regex.
var yourInput = "string here";
re = /[`~!@$%^&*()+\=;'",.<>\{\}\[\]\\\/]/gi;
var isSplChar = re.test(yourInput);
if(isSplChar)
{
var no_spl_char = yourInput.replace(/[`~!@$%^&*()+\;'",.<>\{\}\[\]\\\/]/gi, '');
$(this).val(no_spl_char);
}
i want similiar version for php i tried below code but i gives error
$input_lines="string here";
preg_replace("/[`~!@$%^&*()+\;'",.<>\{\}\[\]\\\/]/", "", $input_lines);
what am i missing