Hi, I am trying to move a old Classic ASP site to run in PHP. I am rewriting bits of it, however I have come across the following function that is causing me some problems. Basically the function FixForSQL
is run on everything before adding it to the database and then FixForHTML
is run on data returned with a SQL query to format it for display.
At the moment if I display a block of text retrieved from the database in PHP it shows as one huge block of text with no paragraph breaks, I presume because I haven't done the replace of Chr(13)
and whatever Chr(9)
is!
Does anyone know how to reproduce whatever is happening in PHP 5?
Function FixForHTML(tmpText1)
Dim tmpText2
tmpText2 = tmpText1
tmpText2 = Replace(tmpText2,Chr(13),"</p><p>" & vbCrLf)
tmpText2 = Replace(tmpText2,Chr(9),"    ")
FixForHTML = tmpText2
End Function
Function FixForSQL(tmpText1)
Dim tmpText2
tmpText2 = tmpText1
tmpText2 = Replace(tmpText1,vbCrLf,Chr(13))
tmpText2 = Replace(tmpText2,Chr(39),String(2,39))
FixForSQL = tmpText2
End Function