...

View Full Version : String Line returns



xman51
06-21-2005, 10:05 PM
Hello All,

Does anyone know how to echo with line returns?

Here is my code:


echo "<script language='JavaScript'>" .
"var isInternetExplorer = navigator.appName.indexOf('Microsoft') != -1;" .
"function Testbutton_DoFSCommand(command, args) {" .
"var TestbuttonObj = isInternetExplorer ? document.all.Testbutton : document.Testbutton;" .
"alert('Command: ' + command + ' Args: ' + args)" .
"}" .
"}" .
"if (navigator.appName && navigator.appName.indexOf('Microsoft') != -1 && navigator.userAgent.indexOf('Windows') != -1 &&

navigator.userAgent.indexOf('Windows 3.1') == -1) {" .
"document.write('<script language=\"VBScript\"\>\n');" .
"document.write('On Error Resume Next\n');" .
"document.write('Sub Testbutton_FSCommand(ByVal command, ByVal args)\n');" .
"document.write(' Call Testbutton_DoFSCommand(command, args)\n');" .
"document.write('End Sub\n');" .
"document.write('</script\>\n');" .
"}" .
"</script>"

I want it to echo a line return at every [color=Red][/ " . color] at the end of each line.

Thanks in advance,

Xman51

schleppel
06-21-2005, 10:24 PM
If you just want it printed out on seperate lines try putting \n". instead of ".

\n is for new lines

Kurashu
06-22-2005, 01:11 AM
Actually, use \r\n.

Fou-Lu
06-22-2005, 04:44 AM
Use Kurashu's \r\n. \n will work in most cases but server os could be configured differently:
\n = *nix
\r\n = Windows
\r = Mac
Kill all birds with one stone.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum