Re: [PHP] Re: Preferred Syntax

2011-12-18 Thread Robert Cummings
On 11-12-17 09:42 AM, Eric Butera wrote: Hi Adam, Thanks for the reply, noted! I was coming from the angle that I've had to deal with a lot of code that is 2000 lines of php/html/javascript inside heredocs, mixed quote escaping, etc. I was hoping to prevent that from becoming a new thing in

Re: [PHP] Re: Preferred Syntax

2011-12-17 Thread Eric Butera
On Sat, Dec 17, 2011 at 12:59 AM, Adam Richardson simples...@gmail.com wrote: On Fri, Dec 16, 2011 at 11:53 PM, Eric Butera eric.but...@gmail.com wrote: To all the people who responded to this thread: It is 2011 - please stop writing code like this. To the OP: I'm glad you're asking

Re: [PHP] Re: Preferred Syntax

2011-12-17 Thread Ross McKay
On Fri, 16 Dec 2011 23:53:46 -0500, Eric Butera wrote: To all the people who responded to this thread: It is 2011 - please stop writing code like this. To the OP: I'm glad you're asking questions and realizing you're not happy with your current abilities and suspect there's a better way. I've

Re: [PHP] Re: Preferred Syntax

2011-12-16 Thread Eric Butera
On Thu, Dec 15, 2011 at 5:46 PM, Ross McKay ro...@zeta.org.au wrote: Jim Lucas wrote: I second this example, with one minor change, I would add '{' and '}' around variables. echo HTML a style=text-align:left;size:14;font-weight:bold   href=/mypage.php/{$page_id}{$page_name}/abr HTML; This

Re: [PHP] Re: Preferred Syntax

2011-12-16 Thread Adam Richardson
On Fri, Dec 16, 2011 at 11:53 PM, Eric Butera eric.but...@gmail.com wrote: To all the people who responded to this thread: It is 2011 - please stop writing code like this. To the OP: I'm glad you're asking questions and realizing you're not happy with your current abilities and suspect

Re: [PHP] Re: Preferred Syntax

2011-12-15 Thread Robert Cummings
On 11-12-15 02:50 AM, Ross McKay wrote: On Wed, 14 Dec 2011 07:59:46 -0500, Rick Dwyer wrote: Can someone tell me which of the following is preferred and why? echo a style='text-align:left;size:14;font-weight:bold' href='/ mypage.php/$page_id'$page_name/abr; echo a

Re: [PHP] Re: Preferred Syntax

2011-12-15 Thread Louis Huppenbauer
Another nice way would be sprintf. So your string really is just a string and nothing more. I don't know how it would affect performance, but just for the eye I find it much simpler. echo sprintf(a style='text-align:left;size:**14;font-weight:bold' href='/mypage.php/%d'%s/abr, $page_id,

Re: [PHP] Re: Preferred Syntax

2011-12-15 Thread Jim Lucas
On 12/14/2011 11:50 PM, Ross McKay wrote: On Wed, 14 Dec 2011 07:59:46 -0500, Rick Dwyer wrote: Can someone tell me which of the following is preferred and why? echo a style='text-align:left;size:14;font-weight:bold' href='/ mypage.php/$page_id'$page_name/abr; echo a

Re: [PHP] Re: Preferred Syntax

2011-12-15 Thread Ross McKay
Jim Lucas wrote: I second this example, with one minor change, I would add '{' and '}' around variables. echo HTML a style=text-align:left;size:14;font-weight:bold href=/mypage.php/{$page_id}{$page_name}/abr HTML; This works for $variables, $objects, and variable functions calls. But

Re: [PHP] Re: Preferred Syntax

2011-12-14 Thread Peter Ford
On 14/12/11 16:48, Al wrote: On 12/14/2011 7:59 AM, Rick Dwyer wrote: Hello all. Can someone tell me which of the following is preferred and why? echo a style='text-align:left;size:14;font-weight:bold' href='/mypage.php/$page_id'$page_name/abr; echo a

Re: [PHP] Re: SQL Syntax

2010-06-17 Thread Ashley Sheridan
On Wed, 2010-06-16 at 15:56 +0200, Carlos Medina wrote: Am 16.06.2010 15:50, schrieb Jan Reiter: Richard, Carlos, Simcha and Nigel, Thank you all for your answers on this matter. When I read Simcha's mail, it hit me like a hammer! That was what I was looking for! BUT: I have to see,

Re: [PHP] Re: heredoc syntax

2004-10-20 Thread Rory Browne
What OS are you using? On windows, you may have problems with the \r\n newline system. I read somewhere that the heredoc syntax requires the use of unix-style \n's Are you getting any error messages. If it didn't work you should get a syntax error. If so what was it? On Wed, 20 Oct 2004

Re: [PHP] Re: correct syntax

2003-06-25 Thread Chris Hayes
At 10:08 25-6-03, you wrote: Harry Wiens wrote: What would be the correct syntax? 1. $_SESSION[test] in this case test is a constant and must be defined by calling define(test, some_integer_value) before But PHP is extremely tolerant and if it cannot find a defined constant called test, or if

Re: [PHP] Re: correct syntax

2003-06-25 Thread Hidayet Dogan
On Wed, 25 Jun 2003, Chris Hayes wrote: At 10:08 25-6-03, you wrote: Harry Wiens wrote: What would be the correct syntax? 1. $_SESSION[test] in this case test is a constant and must be defined by calling define(test, some_integer_value) before But PHP is extremely tolerant and if it

RE: [PHP] Re: correct syntax

2003-06-25 Thread Ford, Mike [LSS]
-Original Message- From: Chris Hayes [mailto:[EMAIL PROTECTED] Sent: 25 June 2003 12:02 At 10:08 25-6-03, you wrote: Harry Wiens wrote: What would be the correct syntax? 1. $_SESSION[test] in this case test is a constant and must be defined by calling define(test,

RE: [PHP] Re: if syntax

2002-07-12 Thread Ford, Mike [LSS]
-Original Message- From: Chris Earle [mailto:[EMAIL PROTECTED]] Sent: 11 July 2002 18:28 To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: if syntax when it would be just as easy, and more functional, to write this (even saves a few characters, too!): if (x

RE: [PHP] Re: if syntax

2002-07-12 Thread Ford, Mike [LSS]
-Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: 11 July 2002 23:38 [] I apologize profusely to the fans of the alternative syntax who are still using it. I personally find the endxxx; to be more of an eyesore, but that's a religious argument. :-)

Re: [PHP] Re: if syntax

2002-07-12 Thread Chris Earle
Mike Ford [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... -Original Message- From: Chris Earle [mailto:[EMAIL PROTECTED]] Sent: 11 July 2002 18:28 To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: if syntax when it would be just

Re: [PHP] Re: if syntax

2002-07-12 Thread Chris Earle
PHP will tell you you have a syntax error on the very last line of your file, and you have no option but to go back and laboriously hand match all of your braces -- and with each ellipsis representing maybe tens (or even hundreds!) Don't be ridiculous. Any decent editor will

RE: [PHP] Re: if syntax

2002-07-11 Thread Ford, Mike [LSS]
-Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: 11 July 2002 10:54 The alternate syntax with the colons is passe -- I think you'd have to dig pretty deep to find a script old enough that uses it for anything other than demonstration purposes. (Rasmus?)

Re: [PHP] Re: if syntax

2002-07-11 Thread Chris Earle
when it would be just as easy, and more functional, to write this (even saves a few characters, too!): if (x): while (y): ... endwhile; ... endif; You're adding characters... { + } opposed to : + endif; Don't go for the fuzzy Math from the Al Gore

Re: [PHP] Re: if syntax

2002-07-11 Thread Richard Lynch
The alternate syntax with the colons is passe -- I think you'd have to dig pretty deep to find a script old enough that uses it for anything other than demonstration purposes. (Rasmus?) What utter tosh! *All* my scripts use the alternative syntax, as I think braces are an eyesore and an