php - Navigating objects and arrays -


Can you please show an example in php how to capture specific information in some sort of loop, I want [language] and [answer] => [Question] = & gt; Every time it's there. Array ([0] = & gt; stdClass object ([type] = & gt; text [cue] = & gt; stdClass object ([type] => text [text] = & gt; AE ([0] = & gt; STDClass object ([type] = & gt; mean [text] [preferences] = & gt; [language] = & gt; EO [part_of_speech] = & gt; Pripishn) [responses] = & gt; = About [language] = & gt; n [quiz] = & gt; array ([0] => stud class object ([type] => multiple_choose [answer] => pre [Question] => about, related))) [Author] = & gt; StdClass object ([profile] => stdClass object K ([name] = & gt; Tomo [Profail_urli] = & gt; http://smart.fm/users/yubizume [icon_url] = & gt; http://assets2.smart FM / assets / users / Yyubijhyum / Ebbf7_midim.gegg) [username] => yibizum) [language] => eo [dc_creator] => Yubizume [href] => http://smart.fm/items / 830187 [id] = & gt; 830187) [1] = & gt; StdClass object ([type] = & gt; text [cue] = & gt; stdClass object ([type] = & gt; text [text] = & Gt; Pre [sonic] = & gt; [Language] = & gt; EO [part_of_speech] = & gt; Pripipisation] [responses] = & gt; Array ([0] = & gt; stdClass object ([type] => Earth [text] = & gt; About it, (PEP) [son] => http: // Assets0.smart.fm /assets/generated_sounds/2009111923/a857356fb588022411fa21371a96e494.mp3 [language] = & gt; N [Quiz] = & gt; Array ([0] = & gt; Study Class object ([ty pe] = & gt; Akadik_cois [North] = & Gt; PE [question] => about, related (presentation)))))) [author] = & gt; StdClass Object ([profile] = & gt; stdClass Object ([name] = & gt; Ariyadiarena [Profail_urli] = & gt; http://smart.fm/users/AriadneAranea [icon_url] = & gt; http: // a1.twimg Com / profile_images / 489977042 / 2009-01 _-_ New_Year_at_Slimbridge_02_bigger.jpg) [username] = & gt; Ariadnearenia] [language] = & gt; Eo [dc_creator] = & gt; Ariadnearenaa [href] = & Gt; http: //smart.fm/items/1773996 [ID] = & gt; 1773996)

  $ $ objects are random with those objects (as object $ objects) {echo $ object- & gt; Q- & gt; Language; // language foreach ($ object-> $ response as reactions) {// If there are no quiz, then we skip the part given below / we leave it because $ object-> The quiz will give a warning or notice if "quiz" is not present in the $ object (! Isset ($ object-> Quiz)) {continue; } // quizzes foreign ($ response-> $ quiz as quiz) {echo $ quiz-> questions; // question echo $ quiz-> answer; // answer}}}  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -