Skip to content

Instantly share code, notes, and snippets.

@guanguans
Last active February 24, 2023 13:38
Show Gist options
  • Save guanguans/e068d0f1a987e5e25e1187d97aed558b to your computer and use it in GitHub Desktop.
Save guanguans/e068d0f1a987e5e25e1187d97aed558b to your computer and use it in GitHub Desktop.
#json #php
<?php
// json_decode returns NULL with validated json data, error: "Control character error, possibly incorrectly encoded"
json_decode(preg_replace('/[[:cntrl:]]/mu', '', $json), true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment