You are here: Re: Problem with quotes « PHP Programming Language « IT news, forums, messages
Re: Problem with quotes

Posted by Rik on 03/05/07 12:49

Rik <luiheidsgoeroe@hotmail.com> wrote:

> <andy.z@blueyonder.com> wrote:
>
>>
>> I'm writing a PHP line to the foot of a file using another language. =
my
>> problem is I'm not sure how to write it so that the quotes (both sing=
le
>> and double) are corret for PHP to process.
>>
>> The language I'm writing the PHP line with uses single quotes for a =

>> print
>> statement.
>>
>> Therefore the line I want to write is (reducing to a single array
>> element to simplify):
>>
>> $myArray =3D ( "Quote" =3D> "It's time, "he said."" );
>>
>> As you can see the quotes are complex already - but this line must be=

>> written from another language enclosed in single quotes as:
>>
>> print '$myArray =3D ( "Quote" =3D> "It's time, "he said."" );'
>>
>> So - my question is - how on earth do I escape such a thing?
>>
>>
>> Can anyone help please?
>
>
> heredoc?
> print '$myArray =3D ( "Quote" =3D> <<<HEREDOC
> It's time, "he said."
> HEREDOC
> );'

Offcourse, the single ' probably has to be escaped for your own language=
:

print '$myArray =3D ( "Quote" =3D> <<<HEREDOC
It\'s time, "he said."
HEREDOC
);'
-- =

Rik Wasmus
Posted on Usenet: any site claiming this as original content or me as an=
=

contributing member is wrong.
Ask Smart Questions: http://tinyurl.com/anel

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация