fork download
  1. <?php
  2.  
  3. // your code goes here
  4. $text = 'U1-RNP,SS-A\/Ro, SS-B\/La';
  5. $text = str_replace('\/', '/', $text);
  6. $text = json_encode(['text' => stripslashes(utf8_encode($text))], JSON_UNESCAPED_SLASHES);
  7. var_dump($text);
Success #stdin #stdout 0.02s 25936KB
stdin
Standard input is empty
stdout
string(34) "{"text":"U1-RNP,SS-A/Ro, SS-B/La"}"