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 << href="/mypage.php/{$page_id}">{$page_name} >HTML; > >This works for $variables, $objects, and variable functions calls. But doesn't >work if you try to call functions directly (

Re: [PHP] Preferred Syntax

2011-12-15 Thread Tedd Sperling
On Dec 14, 2011, at 12:09 PM, Peter Ford wrote: > > With respect to tedd and Al, you've misread the question: the important > PHP-related bit is about whether to embed variables in double-quoted strings > or to concatenate them. These are only two of the options, and each has it's > pros and co

Re: [PHP] Unique items in an array

2011-12-15 Thread Marc Guay
> Give it a try, should do what you are wanting. Hi Jim, I appreciate your dedication to this problem but it was solved 2 days ago! :) Thanks Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Unique items in an array

2011-12-15 Thread Jim Lucas
On 12/15/2011 6:24 AM, Marc Guay wrote: >> Assuming you want to make things unique based on the "contact_first_name" >> field, >> how would you decide which record to keep? The first one you run in to, the >> last one you come across, or some other criteria? > > The unique field is actually the

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 "$page_name"; >> >> echo "".$page_name.""; >> [...] > > Just to throw in yet another possibility: > > echo << h

Re: [PHP] OOP problems

2011-12-15 Thread Fatih P.
On 12/15/2011 01:05 PM, Alex Pojarsky wrote: I'm not sure I've understood you correctly, but you may try something like the following primitive autoloader (I didn't debug it, it's just an example): class Base { protected $_path = ''; public function construct($base_path) {

Re: [PHP] Unique items in an array

2011-12-15 Thread Marc Guay
> Assuming you want to make things unique based on the "contact_first_name" > field, > how would you decide which record to keep?  The first one you run in to, the > last one you come across, or some other criteria? The unique field is actually the contact_id. Marc -- PHP General Mailing List (

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("%s", $page_id, $page_name); 2011/12/15 Robert Cummings > On 11-12-15 02:50 AM, Ross McKay wrote: >

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 "$page_name"; echo "".$page_name.""; [...] Just to throw in yet another possibility: echo<<$page_name HTML; I love HEREDO

Re: [PHP] OOP problems

2011-12-15 Thread Alex Pojarsky
I'm not sure I've understood you correctly, but you may try something like the following primitive autoloader (I didn't debug it, it's just an example): class Base { protected $_path = ''; public function construct($base_path) { $this->_path = $base_path; } public func

[PHP] OOP problems

2011-12-15 Thread Dominik Halvoník
Hello, I would like to ask you for help. This days I am trying to build one of my applications. But I have problem which stopped me. I have folder whit php files like connect.php, delete.php etc. These files contains classes named the same as files. So in file connect.php is class Connect. These f