donglian2106 2013-02-08 03:00
浏览 15

preg_replace与样式格式问题

I have this text stored in my databse:

 <div style=\"font-family:arial black;font-size:20px;text-align:center;color:#3333ff;font-weight:700;\">testing editor</div>

now when trying to process it to my website editor I'm using this function:

function striplen($Text)
{
// strip slashes
$Text = stripslashes($Text);
// find the errors quote
$errors = array("#
#", '#"#');
// find the correct self content
$corrected = array('
', '');

return preg_replace($errors, $corrected, $Text);
}

this out put the text like this:

<div style=font-family:arial black;font-size:20px;text-align:center;color:#3333ff;font-weight:700;>testing editor</div>

as you can see the double quotes from the style tag disappeared?

any suggestions?

many thanks,

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
    • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
    • ¥15 相敏解调 matlab
    • ¥15 求lingo代码和思路
    • ¥15 公交车和无人机协同运输
    • ¥15 stm32代码移植没反应
    • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
    • ¥100 连续两帧图像高速减法
    • ¥15 如何绘制动力学系统的相图
    • ¥15 对接wps接口实现获取元数据