板邓:php str_replace单双引号的替换问题

mystring=replace(mystring,chr(39),"´") '替换单引号

mystring=replace(mystring,chr(34),""")    '替换双引号

 

mystring=replace(mystring,"<","&lt;")    '替换<

mystring=replace(mystring,">","&gt;")    '替换>

mystring=replace(mystring,chr(13),"<br>") '替换回车符

mystring=replace(mystring,chr(32),"&nbsp;") '替换空格符

mystring=replace(mystring,chr(9),"&nbsp; &nbsp; &nbsp; &nbsp;") '替换tab符

 

‘以下将src路径替换为全路径,以便图片分享时可以找到路径

tempstr = dr("content")
                        tempstr = Replace(tempstr, Chr(34), "&quot;")
                        tempstr = Replace(tempstr, "src=&quot;/", "src=&quot;" & Config.yuanchengpath & "/")
                        tempstr = Replace(tempstr, "&quot;", Chr(34))

posted @ 2016-12-19 12:36 板邓 阅读(...) 评论(...) 编辑 收藏