php - Break Row to Carriage Return preg_replace -
php - Break Row to Carriage Return preg_replace -
i trying utilize preg_replace convert <br> or <br /> carriage homecoming ( ). problem seems either doesn't find <br>'s or doesn't recognize hex code i'm trying pass in. here relevant php:
preg_replace('`<br(?: /)?>(\x{13}/u)`', '$1', $content); other information: strings passing in have " don't think interfere preg_replace(). here couple links have helped me far: http://www.webmasterworld.com/forum21/10973.htm (use carriage homecoming instead of \n in tooltips) http://us2.php.net/manual/en/reference.pcre.pattern.modifiers.php#58409 (use \x{13} instead of 
)
hmmm, seem have preg_replace formatted little strange. not sure why doing backreferences that? simple this, first variable should regex. 2nd should replacement, , 3rd should subject:
preg_replace('%<br.*?>%', ' ', $content); i think work, not great @ regexes. .*? should match characters next >
php
Comments
Post a Comment