before translate - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of before translate.php

  1. <?php
  2. $string = "Virginia was <s#001><s#006><s#003><s#019><s#020><s#022><s#015><s#018>\nshe said <s#055><s#060><s#056><s#059><s#054>morning is your \nit was the <s#057><s#076><s#078><s#067><s#072>skeptical Вирджиния была <s#001><s#018><s#003><s#019><s#020><s#063><s#070><s#018>\nона сказала <s#055><s#060><s#056><s#059><s#054>morning является\nэто был <s#057><s#076><s#078><s#067><s#072>skeptical";
  3. //$pattern = '(<)s#(\\d{3}>)';
  4. $pattern = '/(<) *?[sS] *?# *?(\d{3}) *?(>)/';
  5. $replacement = '$1$2$3';
  6. echo preg_replace($pattern, $replacement, $string);
File Description
  • before translate
  • PHP Code
  • 08 Nov-2017
  • 590 Bytes
You can Share it: