$sanitizer->markupToLine() method

Convert a string containing markup or entities to be a single line of plain text

This is the same as the [$sanitizer->markupToText()](/api/ref/sanitizer/markup-to-$sanitizer->markupToText()/) method except that the return value is always just a single line.

Usage

// basic usage
$string = $sanitizer->markupToLine(string $value);

// usage with all arguments
$string = $sanitizer->markupToLine(string $value, array $options = []);

Arguments

NameType(s)Description
valuestring

Value to convert

options (optional)array

Options to modify default behavior:

  • newline (string): Character(s) to replace newlines with (default=" ").
  • separator (string): Character(s) to separate HTML
  • items with (default=", ").
  • entities (bool): Entity encode returned value? (default=false).
  • trim (string): Character(s) to trim from beginning and end of value (default=" -,:;|\n\t").

Return value

string

Converted string of text on a single line


$sanitizer methods and properties

API reference based on ProcessWire core version 3.0.148

Twitter updates

  • New post: ProcessWire core updates (January 31, 2020)— More
    31 January 2020
  • Weekly update for Jan 10, 2020—front-end file uploads in LoginRegisterPro with InputfieldFrontendFile module: More
    10 January 2020
  • If you haven't seen it yet, be sure to check out this great infographic by @teppokoivula in ProcessWire Weekly #294— How ProcessWire professionals work—the results of our recent weekly polls summarised: weekly.pw/issue/294/#how…
    3 January 2020

Latest news

  • ProcessWire Weekly #299
    In the 299th issue of ProcessWire Weekly we're going to walk you through the latest updates to the core, introduce two brand new third party modules, and more. Read on!
    Weekly.pw / 1 February 2020
  • ProcessWire 3.0.148 new master
    Today we have a new master version released, version 3.0.148! The last master version was 3.0.123, so there are 25 new versions worth of upgrades, fixes and optimizations in this new master version, relative to the previous. In this post we’ll take a closer look at what’s new, how to upgrade, and more.
    Blog / 3 January 2020
  • Subscribe to weekly ProcessWire news

“ProcessWire is like a breath of fresh air. So powerful yet simple to build with and customise, and web editors love it too.” —Margaret Chatwin, Web developer