Welcome Guest, Not a member yet? Register   Sign In
Dynamic variable from object
#1

[eluser]skribe[/eluser]
Hi folks:

I'm having some difficulty in working how to achieve this. I have a (join) table that holds contact information.

person
contact_type
contact_details

Different people have different contact types and I want to be able to separate them out so I can do the update form of my CRUD. Is there a way for my to dynamically create variables from an object?

Code:
For instance:
foreach($contact as $item):
    $ . $item->type . = . $item->details;
endforeach;


If not is there an alternative method?

TIA

skribe


Messages In This Thread
Dynamic variable from object - by El Forum - 02-15-2011, 08:02 PM
Dynamic variable from object - by El Forum - 02-15-2011, 11:43 PM
Dynamic variable from object - by El Forum - 02-16-2011, 12:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB