Re: Perl & PHP output format mismatching
| From: | Richard Lynch | Date: | Mon, 15 May 2006 23:28:32 +0000 |
| Subject: | Re: Perl & PHP output format mismatching | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-236235@lists.php.net to get a copy of this message | ||
On Mon, May 15, 2006 4:21 am, mickb@free.fr wrote:
> I'm currently writing a PHP page, which uses a small Perl script. But
> I
> encounter an annoying problem with endline character.
>
> A small example :
>
> $perl = new Perl();
> $perl->eval('print "toto\ntata"');
Your apostrophes in PHP don't interpolate anything except:
\' an embedded apostrophe
\\ an embedded backslash
$perl = new Perl();
$perl->eval("print \"toto\ntata\"");
would work.
If Perl is okay with ' for a string delimiter, this would also work:
$perl->eval("print 'toto\ntata'");
and maybe be more readable to a novice PHP developer.
Homework:
http://php.net/manual/en/language.types.string.php
--
Like Music?
http://l-i-e.com/artists.htm