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.
Result of php executing
Full code of before translate.php
- <?php
- $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";
- //$pattern = '(<)s#(\\d{3}>)';
- $pattern = '/(<) *?[sS] *?# *?(\d{3}) *?(>)/';
- $replacement = '$1$2$3';
- echo preg_replace($pattern, $replacement, $string);