Estos es VB, no creo que tengas problema en convertirlo. Encontré el código en la web, no recuerdo el sitio.
Código PHP:
Public Function Title(ByVal [String] As String, Optional ByVal Separator As String = " ") As String
Dim ret As String
If [String].IndexOf(Separator) > -1 Then
Dim strs As String() = [String].Split(Separator) 'split all the words so to capitalize the first letter of each'
For i As Integer = 0 To strs.Length - 1
If strs(i).Length = 1 Then
strs(i) = strs(i).ToUpper
Else
strs(i) = strs(i).Substring(0, 1).ToUpper & strs(i).Substring(1)
End If
Next
ret = String.Join(Separator, strs) 'join them back together'
End If
Return ret
End Function