fork download
  1. <?php
  2. $json = '{"regex":["Hello\\\s+World"]}';
  3.  
  4. $obj1 = json_decode($json);
  5. echo $obj1->regex[0]."<br>";
  6.  
  7. $obj2 = json_decode($json, true); //When assoc == TRUE, returned objects will be converted into associative arrays.
  8. echo $obj2["regex"][0];
  9. ?>
Success #stdin #stdout 0.02s 82560KB
stdin
Standard input is empty
stdout
Hello\s+World<br>Hello\s+World