php - Passing object as a string in a variable -


itemprop = "text">

I have these parts of code:

  public function setAction ($ action, $ Parameter = array ()) {$ actionUri = strtolower ($ verb); $ ZanoxAuth = new ApiAuthorization (); $ ZanoxAuth- & gt; SetConnectId (__ZANOX_CONNECT_ID); $ ZanoxAuth- & gt; SetSecretKey (__ZANOX_SECRET_KEY); Default number of items in the * / * * JSON * response * / $ defaultResults = __ZANOX_JSON_DEFAULT_RESULTS; $ ZanoxAuth- & gt; Settimestamp (GMDET ("D, Dm YH: I: ST")); $ Timestamp = $ zanoxAuth-> GetTimestamp (); $ Non = $ zanoxAuth-> GetNonce (); / * * URI query inclusion * / $ queries = ''; If questions $ = (is_array ($ parameter) & amp; amp; ($ parameter) & gt; 0) foreach ($ value as $ value $ param = & gt). "& $ Param = $ value"; / * * JSON * Getting the first page of the response * / $ result = $ this- & gt; CurlMe (__ZANOX_ENDPOINT "$ actionUri", __ZANOX_CONNECT_ID "$ questions & amp; connectid =?"; .. page = 0 & item = $ defaultResults & date = $ timestamp & temporarily = $ temporary By & amp; sign = ". $ ZanoxAuth-> getSignature ('GET /', $ action, $ non); $ Result = json_decode ($ result); / * * There are more items to get by looping on the page or not. * / If ($ result- & gt; Total & gt; $ default result) {$ pages = ceil ($ result- & gt; total / $ default result); For {$ i = 1; $ i & lt; $ pages; $ i ++} {$ nonce = $ zanoxAuth-> GetNonce (); $ AddJSON = $ this- & gt; CurlMe (__ZANOX_ENDPOINT "$ actionUri", "? Connectid =" __ZANOX_CONNECT_ID "$ questions & page .. $ i & amp; item = $ defaultResults & date = $ timestamp & temporarily = $ temp Form & sign = ". $ ZanoxAuth-> getSignature ('GET /', $ verb, $ non)); $ AddJSON = json_decode ($ addJSON); / * * Adding JSON items to the main one * / Foreach ((array) $ addJSON-> programApplicationItems-> $ newItem form programApplicationItem) $ results & gt; ProgramApplicationItems-> ProgramApplicationItem [] = $ newItem; }} $ This-> Action = $ results; $ This return; }  

Where do you see $ results & gt; ProgramApplicationItems-> ProgramApplicationItem [] = $ newItem; I want to pass the parameters of the object as a variable, such as:

  $ result-> $ Action "item" - & gt; $ Action "item" [] = $ newItem  

Obviously the above do not work. I thought about var_dump or var_export , but I'm not sure they are going to work any help? Thanks a lot.

Use curly braces: { } :

  $ result-> {$ Action "item"} - & gt; {$ Action "item"} [] = $ newItem;  

Comments