Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
JsonValidator.php
Go to the documentation of this file.
1 <?php
7 
12 {
19  public function isValid($string)
20  {
21  if ($string !== false && $string !== null && $string !== '') {
22  json_decode($string);
23  if (json_last_error() === JSON_ERROR_NONE) {
24  return true;
25  }
26  }
27  return false;
28  }
29 }