Function __global->nl2br

Definitions

sources_custom/phpstub.php

  • Inserts HTML line breaks before all newlines in a string.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$in string No No required parameter N/A N/A In
$is_xhtml boolean No No True N/A N/A Whether to use XHTML compatible line breaks or not

Returns

  • Out
  • Type: string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Inserts HTML line breaks before all newlines in a string.
 *
 * @param  string $in In
 * @param  boolean $is_xhtml Whether to use XHTML compatible line breaks or not
 * @return string Out
 */

function nl2br(string $in, bool $is_xhtml = true) : string