"John Doe", "age" => 32, "favorite color" => "blue", ); echo "var user = ".CUtil::PhpToJSObject($myArray).";"; ?>This code will output a JavaScript variable named `user` with an object made from `$myArray`, but with any dangerous characters escaped. The CUtil JSEscape function is part of the Bitrix Framework, a commercial web application framework developed by Bitrix, Inc.