what you suggest to use instead of stripslashes() if my message having \t or something like \" this
Without this function i get this type of error
Invalid regular expression: /^[\\d-+,]+[\\d]$/: Range out of order in character class
This is my php code :
$jsonFormat = stripslashes(json_encode($this->vaidatorArr, JSON_UNESCAPED_SLASHES));
$removedQuotesFromString = preg_replace('/\"\/(.*?)\/"/', '/$1/', $jsonFormat); // Removed regex double quotes from regex value
$removedQuotesFromString = preg_replace('/"([^"]+)"\s*:\s*/', '$1:', $removedQuotesFromString);
$removedExtraBracesFromString = substr($removedQuotesFromString, 1, -1); // Removed first and last bracket
$this->validationJson = $removedExtraBracesFromString.',';