Carved in mystic runes upon the very living rock, the last words of
stevek of comp.lang.php make plain:
[color=blue]
> Alan Little wrote:[color=green]
>> Carved in mystic runes upon the very living rock, the last words of
>> stevek of comp.lang.php make plain:
>>[color=darkred]
>>> stevek wrote:
>>>> Following code does not produce any new lines. Any ideas.
>>>>
>>>> echo "This spans\multiple lines. The newlines will be\noutput as
>>>> well.";
>>> Sorry ... spell checker corrected some.
>>>
>>> echo "This spans\nmultiple lines. The newlines will be\noutput as
>>> well.";[/color]
>>
>> So, you're saying that this will output the literal string:
>>
>> This spans\nmultiple lines. The newlines will be\noutput as well.
>>
>> Is the bit you posted above a direct cut-and-paste from your script?
>> If not, check that you are in fact using double quotes and not
>> single.
>>[/color]
> <?php
>
> $conn = @mysql_connect( "campania", "sfk", "" )
> or die( "Sorry - could not connect to MySQL" );
> echo "$conn\n";
> //$rs1 = @mysql_create_db( $_REQUEST['db'] );
> echo "This spans\nmultiple lines. The newlines will be\noutput as
> well."; ?>
>
> produces......
>
> Resource id #2 This spans multiple lines. The newlines will be output
> as well.[/color]
If you mean it outputs this in your browser (I don't see a shebang line,
so I assume you're not running this on the command line), then Robert
gave you the answer. A newline is equivalent to a space, in HTML.
--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/