$string = "This is 'test' value."; $escaped_string = CUtil::addslashes($string); echo $escaped_string; // Output: This is \'test\' value.
$array = array("name" => "John O'Connor", "age" => 25); $escaped_array = CUtil::addslashes($array); print_r($escaped_array); // Output: Array ( [name] => John O\'Connor [age] => 25 )Package Library: The CUtil addslashes function is a part of the Bitrix Framework library which is used in the Bitrix CMS platform.