You are here

23 November 2012

How to turn plain text URLs into active links in Drupal.

Source code viewer
  1. $str = 'Turn this text URL into html link: http://browse-tutorials.com';
  2. module_load_include('module', 'filter', 'filter');
  3. $filter = new stdClass();
  4. $filter->settings = array(
  5. 'filter_url_length' => 80,
  6. );
  7. print _filter_url($str, $filter);
Programming Language: PHP