Question
Working with an API (PHP) question
I am building a mini-app using an API into another back-end
system. To
extract data from this system, I can use PHP lines like this -
$stats = $q->campaignStats($cid);
where the variable "$q" has been previously loaded with values.
What I want to know is - can I programatically generate this line? What I'd
LIKE to do would be something like this (analogous to the way that DW builds
query strings) -
$statsQuery = 'campaign' . $command . "($cid)"
and then I can set $command to any of a number of different values, e.g.,
"ClickStats", "Bounces", "Unsubscribes", etc.
Now - what I don't know how to do is to then reference this string in a way
that executes the command, as I'm fairly sure that -
$stats = $q->$statsQuery; would fail (but I'm going to try it of course).
Is there a special way to handle such things?
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================
extract data from this system, I can use PHP lines like this -
$stats = $q->campaignStats($cid);
where the variable "$q" has been previously loaded with values.
What I want to know is - can I programatically generate this line? What I'd
LIKE to do would be something like this (analogous to the way that DW builds
query strings) -
$statsQuery = 'campaign' . $command . "($cid)"
and then I can set $command to any of a number of different values, e.g.,
"ClickStats", "Bounces", "Unsubscribes", etc.
Now - what I don't know how to do is to then reference this string in a way
that executes the command, as I'm fairly sure that -
$stats = $q->$statsQuery; would fail (but I'm going to try it of course).
Is there a special way to handle such things?
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================
