[PHP] Quotes in Heredoc
Dear All, I am learning PHP by reading a book. My query pertains to the following lines : - $form_str = <<< EOFORMSTR . My query is that is it true that we don't need to do ie. we don't need to quote the value of the options in Heredoc. Is that correct? Many thanks, Ashim.
[PHP] Infosys FYI
Det gik op for mig at i tilmeldingsstresset fik jeg taget 2010 databasen ned. Den er nu tilgængelig igen. Man bruger: - http://archive.fastaval.dk/2010/infosys/ for at set 2010 udgaven - http://infosys.fastaval.dk/ for at se 2011 udgaven Derudover er 2009 udgaven stadig tilgængelig på http://archive.fastaval.dk/2009/infosys/ De samme adgangskoder skulle virke til både 2010 og 2011. Regards Peter -- WWW: plphp.dk / plind.dk LinkedIn: plind BeWelcome/Couchsurfing: Fake51 Twitter: kafe15 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quotes in Heredoc
On Sat, 2011-02-26 at 14:41 +0530, Ashim Kapoor wrote: > Dear All, > > I am learning PHP by reading a book. My query pertains to the following > lines : - > > $form_str = <<< EOFORMSTR > WIDTH=621> > > SRC=../images/spacer.gif> > > > . > > My query is that is it true that we don't need to do > > > ie. we don't need to quote the value of the options in Heredoc. Is that > correct? > > Many thanks, > Ashim. The quotes you mention are in the HTML, nothing to do with PHP. HTML will work without the quotes in most cases (unless there's a space in the value for the attribute) but the quotes are required in XHTML and will cause unexpected results. The only difference Heredoc makes in PHP is that the strings you write don't require characters to be escaped, which you would have to do normally in traditional quoted strings. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] Quotes in Heredoc
The quotes you mention are in the HTML, nothing to do with PHP. HTML will work without the quotes in most cases (unless there's a space in the value for the attribute) but the quotes are required in XHTML and will cause unexpected results. Can you elaborate on the XHTML part? Do you mean they are required in XHTML but optional in HTML ? Many thanks, Ashim.
[PHP] Log Rotation, leave it to OS or do it in PHP code?
Dear list, It seems that Python has already a Log Rotation mechanism, which solves the problem of log file growth. I'm wondering whether there is any PHP-based solution around? Now let me ask from a different view: Is it a good approach to implement the Rotation mechanism to PHP? (Code Level) Or leave the job to the operating system and other utilities? Where is the right place to implmenet the Rotation? In Code? In OS? PHP? or a Bash Script? Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quotes in Heredoc
On Sat, 2011-02-26 at 16:27 +0530, Ashim Kapoor wrote: > The quotes you mention are in the HTML, nothing to do with PHP. HTML will > work without the quotes in most cases (unless there's a space in the value > for the attribute) but the quotes are required in XHTML and will cause > unexpected results. > > Can you elaborate on the XHTML part? Do you mean they are required in XHTML > but optional in HTML ? > > Many thanks, > Ashim. Yes, in HTML the quotes are optional, but they are required in XHTML documents: http://www.w3.org/TR/xhtml1/diffs.html#h-4.4 Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] Log Rotation, leave it to OS or do it in PHP code?
On Sat, 2011-02-26 at 16:37 +0330, AmirBehzad Eslami wrote: > Dear list, > > It seems that Python has already a Log Rotation mechanism, > which solves the problem of log file growth. > > I'm wondering whether there is any PHP-based solution around? > Now let me ask from a different view: > > Is it a good approach to implement the Rotation mechanism to PHP? (Code Level) > Or leave the job to the operating system and other utilities? > > Where is the right place to implmenet the Rotation? In Code? In OS? > PHP? or a Bash Script? > > Thanks, > Personally, I would leave it to the OS and other tools, the reason being that it may not necessarily be the programmer who is managing the server as well. I've worked in a couple of places large enough to have dedicated server guys (and gals) who dealt with deploying managing the servers and their services. They may have a preferred way of rotating and archiving logs that is managed on all the log files, regardless of what scripting language was used to create them. If you're working in a smaller environment that doesn't have different staff supporting the servers, I would still keep the log rotation separate, but you manage this in a number of ways, either leaving it to the OS, write a bash script, PHP script, or some sort of off-the-shelf solution. I would be careful not to clutter an app too much with things it may not need to, and having the rotation dealt with independently means that it can be a utility shared by many of your scripts. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] Quotes in Heredoc
Yes, in HTML the quotes are optional, but they are required in XHTML documents: > http://www.w3.org/TR/xhtml1/diffs.html#h-4.4 > Ok Thank you, Ashim