[PHP] Re: Preferred Syntax

2011-12-14 Thread Ross McKay
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 "$page_name"; > > echo "".$page_name.""; >[...] Just to throw in yet another possibility: echo <<$page_name HTML; I love HEREDOC for slabs of HTML, sometimes SQL, e

Re: [PHP] How to use a variable variable with an array [solved]

2011-12-14 Thread Nils Leideck
Dear Robert, On 14.12.2011, at 22:02, Robert Cummings wrote: > $path = ‘/path/to/data/in/my/arbitrarily/deep/array/'; > $array = $someBigFatArray; > $focus = &$array; > foreach( explode( '/', $path ) as $step ) > { > if ($step === '' || $step === 'CONFIGURATION’) > { > continue; >

Re: [PHP] How to use a variable variable with an array

2011-12-14 Thread Robert Cummings
On 11-12-14 01:11 AM, Laruence wrote: On Wed, Dec 14, 2011 at 9:27 AM, Nils Leideck wrote: Hi Al, many thanks for your feedback. Unfortunately I don’t know the deepness of the array so I can’t use the nested foreach() idea :-( Let me try to simplify my question (which also helps myself to cl

Re: [PHP] How to use a variable variable with an array

2011-12-14 Thread Nils Leideck
Hi FeIn and Laruence, On 14.12.2011, at 09:47, Nils Leideck wrote: >> function coolFunction( array $array, $search, $separator = ‘###' ) >> { > [...] >> if ( isset( $array[$dimension] ) ) { >> // no more dimensions to search >> if ( empty( $dimensions ) ) { >> return $array[$d

Re: [PHP] Preferred Syntax

2011-12-14 Thread Rick Dwyer
On Dec 14, 2011, at 1:53 PM, > wrote: The key thing to remember here is that this is a preference and not a performance thing. Thank you... this is basically what I wanted to know. I was concerned that not breaking the VARS out separately from the echo'ed text might cause some sort of per

Re: [PHP] Unique items in an array

2011-12-14 Thread Jim Lucas
On 12/13/2011 1:15 PM, Marc Guay wrote: > Hi folks, > > Let's say that I have the following array: > > [0]=> > array(35) { > ["contact_id"]=> > string(3) "356" > ["contact_first_name"]=> > string(4) "Marc" > } > [1]=> > array(35) { > ["contact_id"]=> > string(3) "

RE: [PHP] Preferred Syntax

2011-12-14 Thread admin
> -Original Message- > From: Adam Richardson [mailto:simples...@gmail.com] > Sent: Wednesday, December 14, 2011 2:19 PM > To: Rick Dwyer > Cc: PHP-General > Subject: Re: [PHP] Preferred Syntax > > On Wed, Dec 14, 2011 at 7:59 AM, Rick Dwyer > wrote: > > > Hello all. > > > > Can someone t

Re: [PHP] Preferred Syntax

2011-12-14 Thread Adam Richardson
On Wed, Dec 14, 2011 at 7:59 AM, Rick Dwyer wrote: > Hello all. > > Can someone tell me which of the following is preferred and why? > > echo " href='/mypage.php/$page_id'>$**page_name"; > > echo " href='/mypage.php/".$page_id."**'>".$page_name.""; > > When I come across the above code in line

RE: [PHP] Preferred Syntax

2011-12-14 Thread admin
> -Original Message- > From: Tamara Temple [mailto:tamouse.li...@tamaratemple.com] > Sent: Wednesday, December 14, 2011 1:40 PM > To: Tedd Sperling > Cc: Rick Dwyer; PHP-General > Subject: Re: [PHP] Preferred Syntax > > Tedd Sperling wrote: > > On Dec 14, 2011, at 7:59 AM, Rick Dwyer wrot

Re: [PHP] Preferred Syntax

2011-12-14 Thread Robert Cummings
On 11-12-14 01:10 PM, David Harkness wrote: On Wed, Dec 14, 2011 at 4:59 AM, Rick Dwyer wrote: Can someone tell me which of the following is preferred and why? echo "$**page_name"; echo "".$page_name.""; On Wed, Dec 14, 2011 at 9:09 AM, Peter Ford wrote: Horses for courses. I use w

Re: [PHP] Preferred Syntax

2011-12-14 Thread Tamara Temple
Tedd Sperling wrote: > On Dec 14, 2011, at 7:59 AM, Rick Dwyer wrote: > > > Hello all. > > > > Can someone tell me which of the following is preferred and why? > > > > echo " > href='/mypage.php/$page_id'>$page_name"; > > > > echo " > href='/mypage.php/".$page_id."'>".$page_name.""; > > > > W

Re: [PHP] Preferred Syntax

2011-12-14 Thread David Harkness
On Wed, Dec 14, 2011 at 4:59 AM, Rick Dwyer wrote: > Can someone tell me which of the following is preferred and why? > > echo " href='/mypage.php/$page_id'>$**page_name"; > > echo " href='/mypage.php/".$page_id."**'>".$page_name.""; > On Wed, Dec 14, 2011 at 9:09 AM, Peter Ford wrote: > Hor

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 "$page_name"; echo "".$page_name.""; When I come across the above code in line 1, I have been changing it to what you see in line 2 for no

[PHP] Re: Preferred Syntax

2011-12-14 Thread Al
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 "$page_name"; echo "".$page_name.""; When I come across the above code in line 1, I have been changing it to what you see in line 2 for no other reason than it delineate

Re: [PHP] Preferred Syntax

2011-12-14 Thread Marc Guay
> BBEdit.  Is this just a preference choice or is one method better than the > other? As far as I know it's just preference. Your choice of editor could influence your decision; one form might be given nicer highlighting. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, v

Re: [PHP] Preferred Syntax

2011-12-14 Thread Tedd Sperling
On Dec 14, 2011, at 7:59 AM, Rick Dwyer wrote: > Hello all. > > Can someone tell me which of the following is preferred and why? > > echo " href='/mypage.php/$page_id'>$page_name"; > > echo " href='/mypage.php/".$page_id."'>".$page_name.""; > > When I come across the above code in line 1, I ha

[PHP] Preferred Syntax

2011-12-14 Thread Rick Dwyer
Hello all. Can someone tell me which of the following is preferred and why? echo "$page_name"; echo "".$page_name.""; When I come across the above code in line 1, I have been changing it to what you see in line 2 for no other reason than it delineates out better in BBEdit. Is this jus

Re: [PHP] Question about socket_select

2011-12-14 Thread Mihai Anghel
On Wed, Dec 14, 2011 at 1:25 AM, Matijn Woudt wrote: > On Wed, Dec 14, 2011 at 12:11 AM, Mihai Anghel > wrote: >> Hello, >> >> It appears to me that something is strange with the socket_select function. >> From what I understand the value of the fourth parameter, tv_sec, >> should block the exec

Re: [PHP] How to use a variable variable with an array

2011-12-14 Thread FeIn
maybe something like this if you are willing to get rid of your weird array dimension delimiters (you can use a dot for that for example, see below) $a = array( "a" => array( "b" => array( "c" => array( "d" => array( "e" => array(