PHP string to object name.

Posted by Smickie on Stack Overflow See other posts from Stack Overflow or by Smickie
Published on 2010-05-02T23:52:50Z Indexed on 2010/05/02 23:57 UTC
Read the original article Hit count: 222

Ok I have a string...

$a_string = "Product";

and I want to use this string in a call to a object like this:

$this->$a_string->some_function();

How the dickens do I dynamically call that object?

(don't think Im on php 5 mind)

© Stack Overflow or respective owner

Related posts about php

Related posts about functional-programming