Created
January 10, 2025 23:50
-
-
Save stemar/cd62c5910bcb89a5e312c164200be3bf to your computer and use it in GitHub Desktop.
Reverse function of nl2br()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function br2nl($string) { | |
return preg_replace('/<br(\s*)?\/?>/i', PHP_EOL, $string); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment