I have this piece of code written in ASP.
Function sFormatCSVDetails(ByVal sStrLine, ByRef aStrAtr)
Dim oRe
Dim oMatch ' MatchCollection
Dim sMatch
Dim iCnt
Dim sDetails
sFormatCSVDetails = False
Set oRe = CreateObject("VBScript.RegExp")
Set oMatch = CreateObject("VBScript.RegExp")
oRe.Global = True
oRe.Pattern = "(""([^""]|"""")*""|[^,]*),"
Set oMatch = oRe.Execute(sStrLine)
If ( oMatch.Count <> UBound(aStrAtr) ) Then Exit Function
oRe.Pattern = "(""*""),"
iCnt = 1
For Each sMatch In oMatch
sDetails = sMatch.Value
If ( oRe.Test(sDetails) ) Then
aStrAtr(iCnt) = Replace(Mid(sDetails, 2,Len(sDetails) - 3),"""""","""")
Else
aStrAtr(iCnt) = Left(sDetails, Len(sDetails) - 1)
End If
iCnt = iCnt + 1
next
sFormatCSVDetails = True
End Function
I want this code to convert to PHP but not able to understand the Regular Expression is there someone who can really help me.Its really very urgent.
Garry