w10schools
Login Register
  • Home
  • Tutorials
    • HTML, CSS
      • HTML, HTML5
      • CSS, CSS3
    • XML
    • JavaScript, AJAX
    • PHP
    • Ruby on Rails
      • Ruby
      • Rails
    • ASP.NET
      • ASP
      • C# .NET
    • Java
      • JSP
    • Databases
      • MySQL
      • MSSQL Server
      • Oracle
    • Web Server
      • Windows
      • Linux
      • Apache
      • IIS
    • Design
      • Dreamweaver
      • Flash
      • Photoshop
      • Fireworks
      • CorelDRAW
      • Illustrator
  • References
    • HTML
      • Bootstrap
    • CSS
      • CSS Selectors
      • Sass
    • JavaScript
    • Mobile Apps
      • Cordova
    • Ruby on Rails
      • Ruby
      • Rails
    • PHP
      • Function
      • Language
      • CodeIgniter
      • Phalcon
      • PHPUnit
      • Symfony
      • Drupal
      • Yii
      • Laravel
    • Perl
      • Perl
    • Python
      • Python
      • Django
      • NumPy
      • Pandas
      • scikit-image
      • scikit-learn
      • Statsmodels
      • Matplotlib
    • Lua
      • Lua
    • C, C++
      • C
      • C++
    • Server
      • Docker
      • Apache HTTP Server
      • Nginx
    • Database
      • PostgreSQL
    • Big Data
      • TensorFlow
    • Game Development
      • Phaser
      • LÖVE
  • Articles
    • News
    • General
      • Website Promotion
      • Online Advertising
      • Make Money Online
    • Editorials
    • Interviews
    • Web Roundups
  • Resources
    • Design
      • Fonts
      • Graphics
      • Vectors
      • Templates
      • UI (User Interface)
      • Brushes
      • Patterns, Backgrounds
      • Textures
    • Web Development
      • HTML, CSS
      • XML
      • JavaScript, AJAX
      • Ruby on Rails
      • PHP
      • Java
      • .NET
      • Python
      • Perl
      • Flash
    • Mobile Application Development
      • Mobile Development Tools
      • Swift
    • Online Services
      • Online Storage
      • Web Hosting
  • Tools
    • Generators
Edit
In Place Editing Advanced Editing
  • References
  • PHP
  • CodeIgniter
  • Typography

nl2br_except_pre()

nl2br_except_pre($str)

Parameters:
  • $str (string) โ€“ Input string
Returns:

String with HTML-formatted line breaks

Return type:

string

Converts newlines to <br /> tags unless they appear within <pre> tags. This function is identical to the native PHP nl2br() function, except that it ignores <pre> tags.

Usage example:

$string = nl2br_except_pre($string);
Links:
  • http://www.codeigniter.com/user_guide/helpers/typography_helper.html#nl2br_except_pre
doc_CodeIgniter
doc_CodeIgniter
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.

Popular Articles
CI_Typography::nl2br_except_pre() nl2br_except_pre($str) Parameters: $str (string) โ€“ Input string Returns: Formatted string Return type: string Converts newlines to <br
nl2br (PHP 4, PHP 5, PHP 7) Inserts HTML line breaks before all newlines in a string string nl2br ( stri
v-pre v-pre Does not expect expression Usage Skip compilation for this element and all its children. You can use this for displaying raw mustache tags.
pre_uninstall pre_uninstall(&hook) Class Public methods Adds a pre-uninstall hook that will be passed an Gem::Uninstaller instance and the spec th
pre_match mtch.pre_match รข str Instance Public methods Returns the portion of the original string before the current match. Equivalent to the s


Return to View
  • Facebook
  • Tweet
  • Digg it
  • Stumbleupon
  • Delicious
  • Plus Share

Designed by : w10schools

service@w10schools.com

Our Partners: aeeble โ€“ Providing content publishing and search solutions