ctest - 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 ctest.php

  1. <?php
  2. header('Content-Type: text/html; charset=UTF-8');
  3. $str = "We offer all kind of scrap materials such as  drained lead acid battery scrap on 99. 97%,Used Rails,HMS1&2,Copper Scrap,Nylon Scrap e.t.c 
  4. Contact us via:
  5. Company Name:Wilton Metal & Waste Recycling Limited     What\u2019s app no: \u202a+353\24089\240988\2400367\u202c";
  6. $res = preg_replace('/[^\x20-\x7E]/','', $str);
  7. echo "$res";
  8.  
  9. echo '<hr/>';
  10.  
  11. echo $str = preg_replace_callback('/\\\\u([0-9a-fA-F]{4})/', function ($match) {
  12.     return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
  13. }, $res);
File Description
  • ctest
  • PHP Code
  • 06 May-2022
  • 589 Bytes
You can Share it: