Re: Perl & PHP output format mismatching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 15, 2006 4:21 am, mickb@xxxxxxx 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux