Changeset 741 for trunk/lib/Utilities.inc.php
- Timestamp:
- Dec 29, 2020 3:18:44 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Utilities.inc.php
r738 r741 1683 1683 } 1684 1684 } 1685 1686 /* 1687 * Test if a string is valid json. 1688 * https://stackoverflow.com/questions/6041741/fastest-way-to-check-if-a-string-is-json-in-php 1689 * 1690 * @access public 1691 * @param string $str The string to test. 1692 * @return boolean True if the string is valid json. 1693 * @author Quinn Comendant <quinn@strangecode.com> 1694 * @since 06 Dec 2020 18:41:51 1695 */ 1696 function isJSON($str) 1697 { 1698 json_decode($str); 1699 return (json_last_error() === JSON_ERROR_NONE); 1700 }
Note: See TracChangeset
for help on using the changeset viewer.