Accessing Drupal core functions in object-oriented code: Call to undefined function
It happens because drupal_json_encode() is defined in includes/json-encode.inc, which is not a file that is normally included when Drupal boots. To use that function, you should use code similar to the one drupal_json_encode() uses, although you really should use drupal_json_encode().

include_once DRUPAL_ROOT . '/includes/json-encode.inc';
file_put_contents(drupal_json_encode_helper($feed_array), $path . '/novel.txt');


The code I would use is the following one.

file_put_contents(drupal_json_encode($feed_array), $path . '/novel.txt');