You are here

function cleantalk_is_JSON in Anti Spam by CleanTalk 9.1.x

Same name and namespace in other branches
  1. 8.4 src/lib/Cleantalk/Antispam/Cleantalk.php \Cleantalk\Antispam\cleantalk_is_JSON()
1 call to cleantalk_is_JSON()
Cleantalk::sendRequest in src/lib/Cleantalk/Antispam/Cleantalk.php
Send JSON request to servers

File

src/lib/Cleantalk/Antispam/Cleantalk.php, line 785

Namespace

Cleantalk\Antispam

Code

function cleantalk_is_JSON($string) {
  return is_string($string) && (is_object(json_decode($string)) || is_array(json_decode($string))) ? true : false;
}