On Tue, 03 Feb 2004 23:28:35 GMT, "Jon Smith" <jsmith@NOSPAM. earthlink.net>
wrote:
[color=blue]
>Is there anyway to make new lines in single quotes?[/color]
$answer = 'yes,
there is.';
--
Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>
Andy Hassall wrote:[color=blue]
> On Tue, 03 Feb 2004 23:28:35 GMT, "Jon Smith" <jsmith@NOSPAM. earthlink.net>
> wrote:
>[color=green]
>>Is there anyway to make new lines in single quotes?[/color]
>
> $answer = 'yes,
> there is.';[/color]
Ah! I felt like I was missing something :-)
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
On Tue, 03 Feb 2004 23:28:35 GMT, "Jon Smith"
<jsmith@NOSPAM. earthlink.net> wrote:
[color=blue]
>Is there anyway to make new lines in single quotes?
>
>Thanks,
>
>Jon Smith
>[/color]
You can break single-quoted strings (and double-quoted, for that
matter) over multiple lines.
Ex:
<?php
$string =
'This is
a string
with newlines!';
?>
But if you mean using the literal character(s) \n, then you'd have to
do it like:
Thanks for the help, I thought that was the only way...
JS
"auntie social" <no@thanks.suck er> wrote in message
news:g5f0209sbc aui4njt0bt2rdrd 2ntl66mud@4ax.c om...
| On Tue, 03 Feb 2004 23:28:35 GMT, "Jon Smith"
| <jsmith@NOSPAM. earthlink.net> wrote:
|
| >Is there anyway to make new lines in single quotes?
| >
| >Thanks,
| >
| >Jon Smith
| >
|
| You can break single-quoted strings (and double-quoted, for that
| matter) over multiple lines.
|
| Ex:
|
| <?php
|
| $string =
| 'This is
| a string
| with newlines!';
|
| ?>
|
| But if you mean using the literal character(s) \n, then you'd have to
| do it like:
|
| <?php
|
| $string = 'This is' . "\n" . 'a string' . "\n" . 'with newlines!';
|
| ?>
|
| Which one is easier to read for you? ;)
|
Comment