php - preg_replace with style format issue -
php - preg_replace with style format issue -
i have text stored in databse:
<div style=\"font-family:arial black;font-size:20px;text-align:center;color:#3333ff;font-weight:700;\">testing editor</div>
now when trying process website editor i'm using function:
function striplen($text) { // strip slashes $text = stripslashes($text); // find errors quote $errors = array("#\r\n#", '#"#'); // find right self content $corrected = array('\r\n', ''); homecoming preg_replace($errors, $corrected, $text); }
this out set text this:
<div style=font-family:arial black;font-size:20px;text-align:center;color:#3333ff;font-weight:700;>testing editor</div>
as can see double quotes style tag disappeared?
any suggestions?
many thanks,
php
Comments
Post a Comment