You are here

function search_file_attachments_extract_simple in Search File Attachments 7

Extract simple text.

Parameters

object $file: The file object.

Return value

mixed|string The extracted content.

1 call to search_file_attachments_extract_simple()
search_file_attachments_get_file_content in ./search_file_attachments.inc
Extract the content of the given file.

File

./search_file_attachments.inc, line 119
Heler functions, to hold the .module file clean and smart.

Code

function search_file_attachments_extract_simple($file) {
  $content = file_get_contents(file_create_url($file->uri));
  $content = iconv("UTF-8", "UTF-8//IGNORE", $content);
  $content = htmlspecialchars(html_entity_decode($content, ENT_NOQUOTES, 'UTF-8'), ENT_NOQUOTES, 'UTF-8');
  $content = trim($content);
  return $content;
}